~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_groupcompress.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-02-11 04:02:41 UTC
  • mfrom: (5017.2.2 tariff)
  • Revision ID: pqm@pqm.ubuntu.com-20100211040241-w6n021dz0uus341n
(mbp) add import-tariff tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1066
1066
        # consumption
1067
1067
        self.add_key_to_manager(('key4',), locations, block, manager)
1068
1068
        self.assertTrue(manager.check_is_well_utilized())
1069
 
 
1070
 
 
1071
 
class Test_GCBuildDetails(tests.TestCase):
1072
 
 
1073
 
    def test_acts_like_tuple(self):
1074
 
        # _GCBuildDetails inlines some of the data that used to be spread out
1075
 
        # across a bunch of tuples
1076
 
        bd = groupcompress._GCBuildDetails((('parent1',), ('parent2',)),
1077
 
            ('INDEX', 10, 20, 0, 5))
1078
 
        self.assertEqual(4, len(bd))
1079
 
        self.assertEqual(('INDEX', 10, 20, 0, 5), bd[0])
1080
 
        self.assertEqual(None, bd[1]) # Compression Parent is always None
1081
 
        self.assertEqual((('parent1',), ('parent2',)), bd[2])
1082
 
        self.assertEqual(('group', None), bd[3]) # Record details
1083
 
 
1084
 
    def test__repr__(self):
1085
 
        bd = groupcompress._GCBuildDetails((('parent1',), ('parent2',)),
1086
 
            ('INDEX', 10, 20, 0, 5))
1087
 
        self.assertEqual("_GCBuildDetails(('INDEX', 10, 20, 0, 5),"
1088
 
                         " (('parent1',), ('parent2',)))",
1089
 
                         repr(bd))
1090