def test_make_image_dir_attempts_to_create_img_dir(self): # Arrange cm = StoreWriter(self.directory, self.file_name) cm._file_manager = MagicMock() img_dir = os.path.join(self.directory, "img_dir") # Act cm._make_img_dir() # Assert self.assertEqual(cm._file_manager.make_dir_when_no_dir.call_count, 2) cm._file_manager.make_dir_when_no_dir.assert_called_with(img_dir)
def test_to_image_makes_img_dir(self): # Arrange cm = StoreWriter(self.directory, self.file_name) cm._make_img_dir = MagicMock() cm._make_img_dir.return_value = 'dir' # Act cm.to_image(MagicMock(), MagicMock(), 'name') # Assert cm._make_img_dir.assert_called_once()