452
454
# monkey patch gpg signing mechanism
453
455
breezy.gpg.GPGStrategy = breezy.gpg.DisabledGPGStrategy
454
456
conf = config.MemoryStack('''
455
gpg_signing_command=cat -
456
457
create_signatures=always
458
self.assertRaises(SigningFailed,
459
self.assertRaises(breezy.gpg.SigningFailed,
459
460
commit.Commit(config_stack=conf).commit,
461
462
allow_pointless=True,
832
833
tree2 = branch.create_checkout('repo/tree2')
833
834
tree2.commit('message', rev_id='rev1')
834
835
self.assertTrue(tree2.branch.repository.has_revision('rev1'))
838
class FilterExcludedTests(TestCase):
840
def test_add_file_not_excluded(self):
842
('fid', (None, 'newpath'),
843
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
844
('file', 'file'), (True, True))]
845
self.assertEqual(changes, list(filter_excluded(changes, ['otherpath'])))
847
def test_add_file_excluded(self):
849
('fid', (None, 'newpath'),
850
0, (False, False), ('pid', 'pid'), ('newpath', 'newpath'),
851
('file', 'file'), (True, True))]
852
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))
854
def test_delete_file_excluded(self):
856
('fid', ('somepath', None),
857
0, (False, None), ('pid', None), ('newpath', None),
858
('file', None), (True, None))]
859
self.assertEqual([], list(filter_excluded(changes, ['somepath'])))
861
def test_move_from_or_to_excluded(self):
863
('fid', ('oldpath', 'newpath'),
864
0, (False, False), ('pid', 'pid'), ('oldpath', 'newpath'),
865
('file', 'file'), (True, True))]
866
self.assertEqual([], list(filter_excluded(changes, ['oldpath'])))
867
self.assertEqual([], list(filter_excluded(changes, ['newpath'])))