~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_index.py

  • Committer: Robert Collins
  • Date: 2007-07-13 07:22:42 UTC
  • mto: (2592.5.3 pack-repository)
  • mto: This revision was merged to the branch mainline in revision 2624.
  • Revision ID: robertc@robertcollins.net-20070713072242-vgf4mkayfyjk6zy0
Node references are tab separated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
            "2000\0\0\0data\n"
67
67
            "\n", contents)
68
68
 
 
69
    def test_build_index_reference_lists_are_included_one(self):
 
70
        builder = GraphIndexBuilder(reference_lists=1)
 
71
        builder.add_node('key', ([], ), 'data')
 
72
        stream = builder.finish()
 
73
        contents = stream.read()
 
74
        self.assertEqual("Bazaar Graph Index 1\nnode_ref_lists=1\n"
 
75
            "key\0\0\0data\n"
 
76
            "\n", contents)
 
77
 
 
78
    def test_build_index_reference_lists_are_included_two(self):
 
79
        builder = GraphIndexBuilder(reference_lists=2)
 
80
        builder.add_node('key', ([], []), 'data')
 
81
        stream = builder.finish()
 
82
        contents = stream.read()
 
83
        self.assertEqual("Bazaar Graph Index 1\nnode_ref_lists=2\n"
 
84
            "key\0\0\t\0data\n"
 
85
            "\n", contents)
 
86
 
69
87
    def test_add_node_bad_key(self):
70
88
        builder = GraphIndexBuilder()
71
89
        for bad_char in '\t\n\x0b\x0c\r\x00 ':