~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Robert Collins
  • Date: 2008-07-01 03:49:54 UTC
  • mto: This revision was merged to the branch mainline in revision 3515.
  • Revision ID: robertc@robertcollins.net-20080701034954-5r0c28cocphgv6td
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1411
1411
        test.add_lines(key_cross_border, (key_basis,), ['foo\n'])
1412
1412
        self.assertEqual('fulltext', test._index.get_method(key_cross_border))
1413
1413
        self.assertEqual([("get_parent_map", set([key_basis]))], basis.calls)
1414
 
        basis.calls = []
1415
1414
        # Subsequent adds do delta.
 
1415
        basis.calls = []
1416
1416
        test.add_lines(key_delta, (key_cross_border,), ['foo\n'])
1417
1417
        self.assertEqual('line-delta', test._index.get_method(key_delta))
1418
1418
        self.assertEqual([], basis.calls)
1438
1438
        self.assertEqual([("annotate", key_basis)], basis.calls)
1439
1439
 
1440
1440
    def test_check(self):
1441
 
        # check() must not check the fallback files, its none of its business.
 
1441
        # check() must not check the fallback files, it's none of its business.
1442
1442
        basis, test = self.get_basis_and_test_knit()
1443
1443
        basis.check = None
1444
1444
        test.check()
1493
1493
                    record.get_bytes_as(record.storage_kind))
1494
1494
                self.assertEqual(reference.get_bytes_as('fulltext'),
1495
1495
                    record.get_bytes_as('fulltext'))
1496
 
        # Its not strictly minimal, but it seems reasonable for now for it to
 
1496
        # It's not strictly minimal, but it seems reasonable for now for it to
1497
1497
        # ask which fallbacks have which parents.
1498
1498
        self.assertEqual([
1499
1499
            ("get_parent_map", set([key_basis, key_missing])),
1539
1539
            self.assertEqual(record.sha1, result[1])
1540
1540
            self.assertEqual(record.storage_kind, result[2])
1541
1541
            self.assertEqual(record.get_bytes_as('fulltext'), result[3])
1542
 
        # Its not strictly minimal, but it seems reasonable for now for it to
 
1542
        # It's not strictly minimal, but it seems reasonable for now for it to
1543
1543
        # ask which fallbacks have which parents.
1544
1544
        self.assertEqual([
1545
1545
            ("get_parent_map", set([key_basis, key_basis_2, key_missing])),
1577
1577
                self.assertEqual(reference.storage_kind, record.storage_kind)
1578
1578
                self.assertEqual(reference.get_bytes_as(reference.storage_kind),
1579
1579
                    record.get_bytes_as(record.storage_kind))
1580
 
        # Its not strictly minimal, but it seems reasonable for now for it to
 
1580
        # It's not strictly minimal, but it seems reasonable for now for it to
1581
1581
        # ask which fallbacks have which parents.
1582
1582
        self.assertEqual([
1583
1583
            ("get_parent_map", set([key_basis, key_missing])),
1623
1623
            self.assertEqual(record.sha1, result[1])
1624
1624
            self.assertEqual(record.storage_kind, result[2])
1625
1625
            self.assertEqual(record.get_bytes_as(record.storage_kind), result[3])
1626
 
        # Its not strictly minimal, but it seems reasonable for now for it to
 
1626
        # It's not strictly minimal, but it seems reasonable for now for it to
1627
1627
        # ask which fallbacks have which parents.
1628
1628
        self.assertEqual([
1629
1629
            ("get_parent_map", set([key_basis, key_basis_2, key_missing])),
1655
1655
 
1656
1656
    def test_insert_record_stream(self):
1657
1657
        # records are inserted as normal; insert_record_stream builds on
1658
 
        # add_lines, so a smoke test should be all thats needed:
 
1658
        # add_lines, so a smoke test should be all that's needed:
1659
1659
        key = ('foo',)
1660
1660
        key_basis = ('bar',)
1661
1661
        key_delta = ('zaphod',)
1720
1720
 
1721
1721
    def test_add_mpdiffs(self):
1722
1722
        # records are inserted as normal; add_mpdiff builds on
1723
 
        # add_lines, so a smoke test should be all thats needed:
 
1723
        # add_lines, so a smoke test should be all that's needed:
1724
1724
        key = ('foo',)
1725
1725
        key_basis = ('bar',)
1726
1726
        key_delta = ('zaphod',)
1767
1767
            ("get_parent_map", set([key_left, key_right])),
1768
1768
            ],
1769
1769
            basis.calls[:3])
1770
 
        self.assertEqual(set([key_left, key_right]), set(basis.calls[3][1]))
1771
 
        self.assertEqual('get_record_stream', basis.calls[3][0])
1772
 
        self.assertEqual('unordered', basis.calls[3][2])
1773
 
        self.assertEqual(True, basis.calls[3][3])
 
1770
        last_call = basis.calls[3]
 
1771
        self.assertEqual('get_record_stream', last_call[0])
 
1772
        self.assertEqual(set([key_left, key_right]), set(last_call[1]))
 
1773
        self.assertEqual('unordered', last_call[2])
 
1774
        self.assertEqual(True, last_call[3])