/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 tests/test_shamap.py

  • Committer: Jelmer Vernooij
  • Date: 2009-09-10 13:13:15 UTC
  • mto: (0.200.602 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090910131315-6890xg58pl2jseml
Allow serving remote URLs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
class TestGitShaMap:
34
34
 
35
35
    def test_commit(self):
36
 
        self.map.start_write_group()
37
 
        self.map.add_entry("5686645d49063c73d35436192dfc9a160c672301",
 
36
        self.map.add_entry("5686645d49063c73d35436192dfc9a160c672301", 
38
37
            "commit", ("myrevid", "cc9462f7f8263ef5adfbeff2fb936bb36b504cba"))
39
 
        self.map.commit_write_group()
40
38
        self.assertEquals(
41
39
            ("commit", ("myrevid", "cc9462f7f8263ef5adfbeff2fb936bb36b504cba")),
42
40
            self.map.lookup_git_sha("5686645d49063c73d35436192dfc9a160c672301"))
43
41
 
44
42
    def test_lookup_notfound(self):
45
 
        self.assertRaises(KeyError,
 
43
        self.assertRaises(KeyError, 
46
44
            self.map.lookup_git_sha, "5686645d49063c73d35436192dfc9a160c672301")
47
 
 
 
45
        
48
46
    def test_blob(self):
49
47
        thesha = "5686645d49063c73d35436192dfc9a160c672301"
50
 
        self.map.start_write_group()
51
48
        self.map.add_entry(thesha, "blob", ("myfileid", "myrevid"))
52
 
        self.map.commit_write_group()
53
49
        self.assertEquals(
54
50
            ("blob", ("myfileid", "myrevid")),
55
51
            self.map.lookup_git_sha(thesha))
57
53
 
58
54
    def test_tree(self):
59
55
        thesha = "5686645d49063c73d35436192dfc9a160c672301"
60
 
        self.map.start_write_group()
61
 
        self.map.add_entry(thesha,
 
56
        self.map.add_entry(thesha, 
62
57
            "tree", ("somepath", "myrevid"))
63
 
        self.map.commit_write_group()
64
58
        self.assertEquals(
65
59
            ("tree", ("somepath", "myrevid")),
66
60
            self.map.lookup_git_sha(thesha))
67
61
        self.assertEquals(thesha, self.map.lookup_tree("somepath", "myrevid"))
68
62
 
69
63
    def test_revids(self):
70
 
        self.map.start_write_group()
71
 
        self.map.add_entry("5686645d49063c73d35436192dfc9a160c672301",
 
64
        self.map.add_entry("5686645d49063c73d35436192dfc9a160c672301", 
72
65
            "commit", ("myrevid", "cc9462f7f8263ef5adfbeff2fb936bb36b504cba"))
73
 
        self.map.commit_write_group()
74
66
        self.assertEquals(["myrevid"], list(self.map.revids()))
75
67
 
76
68