class MissingObjectFinderTest(TestCase):
    def setUp(self):
        super(MissingObjectFinderTest, self).setUp()
        self.store = MemoryObjectStore()
        self.commits = []

    def cmt(self, n):
        return self.commits[n - 1]

    def assertMissingMatch(self, haves, wants, expected):
        for sha, path in self.store.find_missing_objects(haves, wants):
            self.assertTrue(sha in expected, "(%s,%s) erroneously reported as missing" % (sha, path))
            expected.remove(sha)

        self.assertEqual(len(expected), 0, "some objects are not reported as missing: %s" % (expected,))
class MissingObjectFinderTest(TestCase):

    def setUp(self):
        super(MissingObjectFinderTest, self).setUp()
        self.store = MemoryObjectStore()
        self.commits = []

    def cmt(self, n):
        return self.commits[n-1]

    def assertMissingMatch(self, haves, wants, expected):
        for sha, path in self.store.find_missing_objects(haves, wants):
            self.assertTrue(sha in expected,
                "(%s,%s) erroneously reported as missing" % (sha, path))
            expected.remove(sha)

        self.assertEqual(len(expected), 0,
            "some objects are not reported as missing: %s" % (expected, ))