예제 #1
0
 def test_creates_flag_file(self, mock_io):
     expected_flag_file = 'bar.bcbiotmp'
     _move_file_with_sizecheck('foo', 'bar')
     transaction.open.assert_called_once_with(expected_flag_file, 'wb')
     transaction.utils.remove_safe.assert_called_once_with(
         expected_flag_file)
예제 #2
0
 def test_fails_if_sizes_arent_equal(self, mock_io):
     transaction.utils.get_size.side_effect = lambda x: x
     with pytest.raises(AssertionError):
         _move_file_with_sizecheck('foo', 'bar')
     assert not transaction.utils.remove_safe.called
예제 #3
0
 def test_moves_files(self, mock_io):
     _move_file_with_sizecheck('foo', 'bar')
     transaction.shutil.move.assert_called_once_with('foo', 'bar')
예제 #4
0
 def test_creates_flag_file(self, mock_io):
     expected_flag_file = 'bar.bcbiotmp'
     _move_file_with_sizecheck('foo', 'bar')
     transaction.open.assert_called_once_with(expected_flag_file, 'wb')
     transaction.utils.remove_safe.assert_called_once_with(
         expected_flag_file)
예제 #5
0
 def test_fails_if_sizes_arent_equal(self, mock_io):
     transaction.utils.get_size.side_effect = lambda x: x
     with pytest.raises(AssertionError):
         _move_file_with_sizecheck('foo', 'bar')
     assert not transaction.utils.remove_safe.called
예제 #6
0
 def test_moves_files(self, mock_io):
     _move_file_with_sizecheck('foo', 'bar')
     transaction.shutil.move.assert_called_once_with('foo', 'bar')