49
49
log.properties_handler_registry = registry.Registry()
51
51
def _cleanup(self):
52
super(TestLongLogFormatter, self).tearDown()
52
super(TestCaseWithoutPropsHandler, self)._cleanup()
53
53
# restore the custom properties handler registry
54
54
log.properties_handler_registry = \
55
55
self.properties_handler_registry
611
611
test_prop: test_value
612
612
author: John Doe <jdoe@example.com>
613
613
committer: Lorem Ipsum <test@example.com>
614
branch nick: test_author_log
614
branch nick: test_properties_in_log
615
615
timestamp: Wed 2005-11-23 12:08:27 +1000
646
646
log.properties_handler_registry.remove(
647
647
'trivial_custom_prop_handler')
649
def test_properties_handler_bad_argument(self):
650
wt = self.make_branch_and_tree('.')
652
self.build_tree(['a'])
654
b.nick = 'test_author_log'
655
wt.commit(message='add a',
656
timestamp=1132711707,
658
committer='Lorem Ipsum <test@example.com>',
659
author='John Doe <jdoe@example.com>',
660
revprops={'a_prop':'test_value'})
662
formatter = LongLogFormatter(to_file=sio)
664
def bad_argument_prop_handler(revision):
665
return {'custom_prop_name':revision.properties['a_prop']}
667
log.properties_handler_registry.register(
668
'bad_argument_prop_handler',
669
bad_argument_prop_handler)
671
self.assertRaises(AttributeError, formatter.show_properties,
674
revision = b.repository.get_revision(b.last_revision())
675
formatter.show_properties(revision, '')
676
self.assertEqualDiff(sio.getvalue(),
677
'''custom_prop_name: test_value\n''')
679
log.properties_handler_registry.remove(
680
'bad_argument_prop_handler')
650
683
class TestLineLogFormatter(TestCaseWithTransport):