def test_load_version_mismatch_error(self): r = Repo(index={}, config=self.conf, connector=self.connector) with self.assertRaises(VersionMismatchError) as cm: r.load_index_from_disk(99) self.assertEqual(cm.exception.actual, 99) self.assertEqual(cm.exception.expected, repo.INDEX_FORMAT_VERSION)
def test_load_index_version_1(self): r = Repo(index={}, config=self.conf, connector=self.connector) r.load_index_from_disk(1) self.assertEqual(r.index, self.pi) self.assertIsNot(r.index, self.pi)
def test_load_index_version_current(self): r = Repo(index={}, config=self.conf, connector=self.connector) r.load_index_from_disk(repo.INDEX_FORMAT_VERSION) self.assertEqual(r.index, self.pi) self.assertIsNot(r.index, self.pi)