/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_knit.py

Iter_lines_added_or_present_in_keys stacks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1453
1453
        pass
1454
1454
 
1455
1455
    def test_iter_lines_added_or_present_in_keys(self):
1456
 
        pass
 
1456
        # Lines from the basis are returned, and lines for a given key are only
 
1457
        # returned once. 
 
1458
        key1 = ('foo1',)
 
1459
        key2 = ('foo2',)
 
1460
        # all sources are asked for keys:
 
1461
        basis, test = self.get_basis_and_test_knit()
 
1462
        basis.add_lines(key1, (), ["foo"])
 
1463
        basis.calls = []
 
1464
        lines = list(test.iter_lines_added_or_present_in_keys([key1]))
 
1465
        self.assertEqual([("foo\n", key1)], lines)
 
1466
        self.assertEqual([("iter_lines_added_or_present_in_keys", set([key1]))],
 
1467
            basis.calls)
 
1468
        # keys in both are not duplicated:
 
1469
        test.add_lines(key2, (), ["bar\n"])
 
1470
        basis.add_lines(key2, (), ["bar\n"])
 
1471
        basis.calls = []
 
1472
        lines = list(test.iter_lines_added_or_present_in_keys([key2]))
 
1473
        self.assertEqual([("bar\n", key2)], lines)
 
1474
        self.assertEqual([], basis.calls)
1457
1475
 
1458
1476
    def test_keys(self):
1459
1477
        key1 = ('foo1',)