from bzrlib.plugins.bzrp4 import git_p4 import unittest class TestGitP4Imported(unittest.TestCase): def test_git_p4__extractSettingsGitLog_empty_input(self): self.assertEquals({}, git_p4.extractSettingsGitLog('')) def test_git_p4__extractSettingsGitLog_typical_input_v2(self): self.assertEquals( {'depot-paths': ['path1', 'path2'], 'change': '1234'}, git_p4.extractSettingsGitLog( '[git-p4: depot-paths = path1,path2: change = 1234]')) def test_git_p4__extractSettingsGitLog_typical_input_v1(self): values = git_p4.extractSettingsGitLog( '[git-p4: depot-path = path1: change = 1234]') self.assertEquals(['path1'], values['depot-paths']) self.assertEquals('1234', values['change']) def test_git_p4_P4Sync__p4_change_description_addendum(self): self.assertEquals(""" [git-p4: depot-paths = "depotPaths": change = change: options = options]""", git_p4.P4Sync._p4ChangeDescriptionAddendum( 'depotPaths', 'change', 'options')) def test_git_p4_P4Export__p4_change_description_addendum(self): self.assertEquals(""" p4: change change1234""", git_p4.P4Export._p4ChangeDescriptionAddendum( 'depotPaths', 'change1234', 'options'))