def testempty(self):
        tree = treestate.treestate(os.path.join(testtmp, "empty"), 0)
        self.assertEqual(len(tree), 0)
        self.assertEqual(tree.getmetadata(), b"")
        self.assertEqual(tree.walk(0, 0), [])
        self.assertTrue(tree.hasdir("/"))
        for path in ["", "a", "/", "b/c", "d/"]:
            self.assertFalse(path in tree)
            if path and path != "/":
                self.assertFalse(tree.hasdir(path))
            if path != "/":
                if path.endswith("/"):
                    self.assertIsNone(tree.getdir(path))
                else:
                    self.assertIsNone(tree.get(path, None))