コード例 #1
0
ファイル: test_model.py プロジェクト: JoProvost/calbum
 def test_get_destination_path_file_doesnt_exist(self, exists):
     exists.return_value = False
     assert_that(
         model.get_destination_path(
             source='origin/path.jpg', dest='dest/path', extension='.jpg'),
         is_('dest/path.jpg'))
     exists.assert_called_with('dest/path.jpg')
コード例 #2
0
ファイル: test_model.py プロジェクト: JoProvost/calbum
 def test_get_destination_path_file_exist_with_same_file_content(self, exists, samefile, filecmp):
     samefile.return_value = False
     filecmp.return_value = True
     exists.side_effect = [
         True
     ]
     assert_that(
         model.get_destination_path(
             source='origin/path.jpg', dest='dest/path', extension='.jpg'),
         is_('dest/path.jpg'))
     exists.has_calls([
         mock.call('dest/path.jpg'),
     ])