Changeset 60:deb52535750d for relatorio/tests/test_api.py
- Timestamp:
- 08/21/08 16:42:38 (5 years ago)
- Branch:
- default
- Files:
-
- 1 modified
-
relatorio/tests/test_api.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
relatorio/tests/test_api.py
r51 r60 36 36 MIMETemplateLoader.load_template_engines() 37 37 38 39 38 class TestRepository(object): 40 39 … … 59 58 eq_(report, report2) 60 59 60 def abspath_helper(self, path): 61 return _absolute(path) 62 61 63 def test_absolute(self): 62 64 "Test the absolute path calculation" 65 eq_("/home/nicoe/python/mock.py", 66 _absolute("/home/nicoe/python/mock.py")) 67 63 68 our_dir, _ = os.path.split(__file__) 64 new_path = _absolute(os.path.join('brol', 'toto')) 69 # We use this because me go up by two frames 70 new_path = self.abspath_helper(os.path.join('brol', 'toto')) 65 71 eq_(os.path.join(our_dir, 'brol', 'toto'), new_path) 66 72 … … 77 83 "Testing the report generation" 78 84 a = StubObject(name='OpenHex') 79 eq_(self.report( a).render(), 'Hello OpenHex.\n')85 eq_(self.report(o=a).render(), 'Hello OpenHex.\n') 80 86 81 87 def test_factory(self): 82 88 "Testing the data factory" 83 89 class MyFactory: 84 def __call__(self, o bj, time, y=1):90 def __call__(self, o, time, y=1): 85 91 d = dict() 86 d['o'] = o bj92 d['o'] = o 87 93 d['y'] = y 88 94 d['time'] = time … … 95 101 96 102 a = StubObject(name='Foo') 97 eq_(report( a, time="One o'clock").render(),103 eq_(report(o=a, time="One o'clock").render(), 98 104 "Hi Foo,\nIt's One o'clock to 2 !\n") 99 eq_(report( a, time="One o'clock", y=4).render(),105 eq_(report(o=a, time="One o'clock", y=4).render(), 100 106 "Hi Foo,\nIt's One o'clock to 5 !\n") 101 107 assert_raises(TypeError, report, a)
