/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_foreign.py

remove all trailing whitespace from bzr source

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
class DummyForeignVcs(foreign.ForeignVcs):
52
52
    """A dummy Foreign VCS, for use with testing.
53
 
    
 
53
 
54
54
    It has revision ids that are a tuple with three strings.
55
55
    """
56
56
 
57
57
    def __init__(self):
58
58
        self.mapping_registry = DummyForeignVcsMappingRegistry()
59
 
        self.mapping_registry.register("v1", DummyForeignVcsMapping(), 
 
59
        self.mapping_registry.register("v1", DummyForeignVcsMapping(),
60
60
                                       "Version 1")
61
61
 
62
62
 
63
63
class ForeignVcsRegistryTests(TestCase):
64
64
 
65
 
    def test_parse_revision_id_no_dash(self):       
 
65
    def test_parse_revision_id_no_dash(self):
66
66
        reg = foreign.ForeignVcsRegistry()
67
 
        self.assertRaises(errors.InvalidRevisionId, 
 
67
        self.assertRaises(errors.InvalidRevisionId,
68
68
                          reg.parse_revision_id, "invalid")
69
 
        
70
 
    def test_parse_revision_id_unknown_mapping(self):       
 
69
 
 
70
    def test_parse_revision_id_unknown_mapping(self):
71
71
        reg = foreign.ForeignVcsRegistry()
72
 
        self.assertRaises(errors.InvalidRevisionId, 
 
72
        self.assertRaises(errors.InvalidRevisionId,
73
73
                          reg.parse_revision_id, "unknown-foreignrevid")
74
74
 
75
75
    def test_parse_revision_id(self):
84
84
 
85
85
    def test_create(self):
86
86
        mapp = DummyForeignVcsMapping()
87
 
        rev = foreign.ForeignRevision(("a", "foreign", "revid"), 
 
87
        rev = foreign.ForeignRevision(("a", "foreign", "revid"),
88
88
                                      mapp, "roundtripped-revid")
89
89
        self.assertEquals("", rev.inventory_sha1)
90
90
        self.assertEquals(("a", "foreign", "revid"), rev.foreign_revid)
96
96
 
97
97
    def setUp(self):
98
98
        super(ShowForeignPropertiesTests, self).setUp()
99
 
        foreign.foreign_vcs_registry.register("dummy", 
 
99
        foreign.foreign_vcs_registry.register("dummy",
100
100
            DummyForeignVcs(), "Dummy VCS")
101
101
 
102
102
    def tearDown(self):
113
113
                          foreign.show_foreign_properties(rev))
114
114
 
115
115
    def test_show_direct(self):
116
 
        rev = foreign.ForeignRevision(("some", "foreign", "revid"), 
117
 
                                      DummyForeignVcsMapping(), 
 
116
        rev = foreign.ForeignRevision(("some", "foreign", "revid"),
 
117
                                      DummyForeignVcsMapping(),
118
118
                                      "roundtrip-revid")
119
119
        self.assertEquals({ "dummy ding": "some/foreign\\revid" },
120
120
                          foreign.show_foreign_properties(rev))