Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/icoz/habraparse.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/habr
diff options
context:
space:
mode:
authoricoz <icoz.vt@gmail.com>2015-05-24 15:47:25 +0300
committericoz <icoz.vt@gmail.com>2015-05-24 15:47:25 +0300
commitbed469b5df6d86e54e104e9a95749c48a8434772 (patch)
tree1c83f6c263a45be78aed958bf46fad40f065ce1d /habr
parent11df6b8fb2a41b419627bf4a89b01d82c1ac6b51 (diff)
Fix issue #4
Добавлен тест на баг #4.
Diffstat (limited to 'habr')
-rw-r--r--habr/user.py29
1 files changed, 16 insertions, 13 deletions
diff --git a/habr/user.py b/habr/user.py
index c70d424..64b7e89 100644
--- a/habr/user.py
+++ b/habr/user.py
@@ -248,30 +248,33 @@ import pprint
class Test_HabraUser(TestCase):
def setUp(self):
self.hu = HabraUser('icoz')
+ self.pp = pprint.PrettyPrinter(indent=4)
pass
def test_parseUserpage(self):
- pp = pprint.PrettyPrinter(indent=4)
- pp.pprint(self.hu.activity())
- pp.pprint(self.hu.profile())
- pp.pprint(self.hu.karma())
+ self.pp.pprint(self.hu.activity())
+ self.pp.pprint(self.hu.profile())
+ self.pp.pprint(self.hu.karma())
def test_favs(self):
- pp = pprint.PrettyPrinter(indent=4)
- # pp.pprint(self.hu.favorites())
+ self.pp.pprint(self.hu.favorites())
+
+ def test_readonly_user(self):
+ self.pp.pprint('starting test for readonly xvitaly')
+ hu = HabraUser('xvitaly')
+ self.pp.pprint('date=')
+ self.pp.pprint(hu.profile()['registration_date'])
def test_user_posts(self):
hu = HabraUser('Zelenyikot')
- pp = pprint.PrettyPrinter(indent=4)
- pp.pprint('userposts=')
- pp.pprint(hu.user_posts())
+ self.pp.pprint('userposts=')
+ self.pp.pprint(hu.user_posts())
def test_rating_place(self):
- pp = pprint.PrettyPrinter(indent=4)
- pp.pprint('starting test for lokkersp')
+ self.pp.pprint('starting test for lokkersp')
hu = HabraUser('lokkersp')
- pp.pprint('karma=')
- pp.pprint(hu.karma())
+ self.pp.pprint('karma=')
+ self.pp.pprint(hu.karma())
class Test_GeektimesUser(TestCase):