Beispiel #1
0
def test_clear():
    mr = MemoryResource()
    mr.create("1", "foo")
    mr.create("2", "bar")
    assert len(mr.list()) == 2
    mr.clear()
    assert len(mr.list()) == 0
Beispiel #2
0
 def test_clear(self):
     mr = MemoryResource()
     mr.create("1", "foo")
     mr.create("2", "bar")
     self.assertEqual(len(mr.list()), 2)
     mr.clear()
     self.assertEqual(len(mr.list()), 0)