~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_index.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Tests for indices."""
18
18
 
558
558
        # not create a new transport request, and should return False (cannot
559
559
        # be in the index) - even when the byte location we ask for is outside
560
560
        # the parsed region
561
 
        # 
 
561
        #
562
562
        result = index._lookup_keys_via_location([(4000, self.make_key(40))])
563
563
        self.assertEqual(
564
564
            [((4000, self.make_key(40)),
1078
1078
        self.assertEqual(set([(index1, ('name', ), 'data', ((('ref', ), ), )),
1079
1079
            (index2, ('ref', ), 'refdata', ((), ))]),
1080
1080
            set(index.iter_entries([('name', ), ('ref', )])))
1081
 
 
 
1081
 
1082
1082
    def test_iter_all_keys_dup_entry(self):
1083
1083
        index1 = self.make_index('1', 1, nodes=[
1084
1084
            (('name', ), 'data', ([('ref', )], )),
1089
1089
        self.assertEqual(set([(index1, ('name', ), 'data', ((('ref',),),)),
1090
1090
            (index1, ('ref', ), 'refdata', ((), ))]),
1091
1091
            set(index.iter_entries([('name', ), ('ref', )])))
1092
 
 
 
1092
 
1093
1093
    def test_iter_missing_entry_empty(self):
1094
1094
        index = CombinedGraphIndex([])
1095
1095
        self.assertEqual([], list(index.iter_entries([('a', )])))
1104
1104
        index2 = self.make_index('2')
1105
1105
        index = CombinedGraphIndex([index1, index2])
1106
1106
        self.assertEqual([], list(index.iter_entries([('a', )])))
1107
 
 
 
1107
 
1108
1108
    def test_iter_entry_present_one_index_only(self):
1109
1109
        index1 = self.make_index('1', nodes=[(('key', ), '', ())])
1110
1110
        index2 = self.make_index('2', nodes=[])