def test_get(self): dpc = DrivePathCache() dpc.put("drive://gsync_unittest", {}) self.assertEqual(dpc.get("drive://gsync_unittest/123"), None) self.assertEqual(dpc.get("drive://gsync_unittest//////"), {}) self.assertEqual(dpc.get("drive://gsync_unittest"), {})
def test_get(self): dpc = DrivePathCache() dpc.put("drive://gsync_unittest", {}) self.assertEqual(dpc.get("drive://gsync_unittest/123"), None) self.assertEqual(dpc.get("drive://gsync_unittest//////"), {}) self.assertEqual(dpc.get("drive://gsync_unittest"), {})
def test_constructor(self): dpc = DrivePathCache({ "junk": "junk", "drive://gsync_unittest/a_valid_path": {} }) self.assertEqual(dpc.get("junk"), None) self.assertEqual(dpc.get("drive://gsync_unittest/a_valid_path"), {})
def test_constructor(self): dpc = DrivePathCache({ "junk": "junk", "drive://gsync_unittest/a_valid_path": {} }) self.assertEqual(dpc.get("junk"), None) self.assertEqual(dpc.get("drive://gsync_unittest/a_valid_path"), {})
def test_clear(self): dpc = DrivePathCache() dpc.put("drive://gsync_unittest/1", {}) dpc.put("drive://gsync_unittest/2", {}) dpc.put("drive://gsync_unittest/3", {}) self.assertEqual(dpc.get("drive://gsync_unittest/1"), {}) self.assertEqual(dpc.get("drive://gsync_unittest/2"), {}) self.assertEqual(dpc.get("drive://gsync_unittest/3"), {}) dpc.clear("drive://gsync_unittest/1") self.assertEqual(dpc.get("drive://gsync_unittest/1"), None) self.assertEqual(dpc.get("drive://gsync_unittest/2"), {}) self.assertEqual(dpc.get("drive://gsync_unittest/3"), {}) dpc.clear("drive://gsync_unittest/2") self.assertEqual(dpc.get("drive://gsync_unittest/1"), None) self.assertEqual(dpc.get("drive://gsync_unittest/2"), None) self.assertEqual(dpc.get("drive://gsync_unittest/3"), {}) dpc.clear("drive://gsync_unittest/3") self.assertEqual(dpc.get("drive://gsync_unittest/1"), None) self.assertEqual(dpc.get("drive://gsync_unittest/2"), None) self.assertEqual(dpc.get("drive://gsync_unittest/3"), None)
def test_clear(self): dpc = DrivePathCache() dpc.put("drive://gsync_unittest/1", {}) dpc.put("drive://gsync_unittest/2", {}) dpc.put("drive://gsync_unittest/3", {}) self.assertEqual(dpc.get("drive://gsync_unittest/1"), {}) self.assertEqual(dpc.get("drive://gsync_unittest/2"), {}) self.assertEqual(dpc.get("drive://gsync_unittest/3"), {}) dpc.clear("drive://gsync_unittest/1") self.assertEqual(dpc.get("drive://gsync_unittest/1"), None) self.assertEqual(dpc.get("drive://gsync_unittest/2"), {}) self.assertEqual(dpc.get("drive://gsync_unittest/3"), {}) dpc.clear("drive://gsync_unittest/2") self.assertEqual(dpc.get("drive://gsync_unittest/1"), None) self.assertEqual(dpc.get("drive://gsync_unittest/2"), None) self.assertEqual(dpc.get("drive://gsync_unittest/3"), {}) dpc.clear("drive://gsync_unittest/3") self.assertEqual(dpc.get("drive://gsync_unittest/1"), None) self.assertEqual(dpc.get("drive://gsync_unittest/2"), None) self.assertEqual(dpc.get("drive://gsync_unittest/3"), None)