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