test_issue.py (614B)
1 # standard imports 2 import unittest 3 import logging 4 import json 5 6 # local imports 7 from piknik import Issue 8 from piknik.identity import Identity 9 10 logging.basicConfig(level=logging.DEBUG) 11 logg = logging.getLogger() 12 13 14 class TestIssue(unittest.TestCase): 15 16 def test_basic(self): 17 o = Issue('foo') 18 r = json.loads(str(o)) 19 self.assertEqual(str(o.id), r['id']) 20 self.assertEqual(o.title, r['title']) 21 22 23 def test_basic_from_str(self): 24 o = Issue('foo') 25 v = str(o) 26 r = Issue.from_str(v) 27 self.assertTrue(o == r) 28 29 30 if __name__ == '__main__': 31 unittest.main()