def testremove(self):
        tree = treestate.treestate(os.path.join(testtmp, "remove"), 0)
        count = 5000
        files = list(itertools.islice(genfiles(), count))
        expected = {}
        for path, bits, mode, size, mtime, copied in files:
            tree.insert(path, bits, mode, size, mtime, copied)
            if (mtime & 1) == 0:
                tree.remove(path)
                if path in expected:
                    del expected[path]
            else:
                expected[path] = (bits, mode, size, mtime, copied)
        self.assertEqual(len(tree), len(expected))
        for path in tree.walk(0, 0):
            self.assertTrue(tree.hasdir(os.path.dirname(path) + "/"))
            self.assertEqual(tree.get(path, None), expected[path])