Esempio n. 1
0
    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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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)
Esempio n. 5
0
    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)
Esempio n. 6
0
    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)