Beispiel #1
0
 def test_exit(self):
     storage = ContentStorage()
     storage.close = Mock()
     storage.__exit__()
     storage.close.assert_called_once_with()
Beispiel #2
0
 def test_enter(self):
     storage = ContentStorage()
     storage.open = Mock()
     inst = storage.__enter__()
     storage.open.assert_called_once_with()
     self.assertEqual(inst, storage)
Beispiel #3
0
 def test_open(self):
     storage = ContentStorage()
     storage.open()
Beispiel #4
0
 def test_close(self):
     storage = ContentStorage()
     storage.close()
Beispiel #5
0
 def test_abstract(self):
     storage = ContentStorage()
     self.assertRaises(NotImplementedError, storage.put, None, None)
     self.assertRaises(NotImplementedError, storage.get, None)