[extra-files] Copy files using existing function

Instead of calling cp as a system command. This will help debug problems
if something fails.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-05-12 13:44:42 +02:00
parent d3b2fbe387
commit b67f6369db
4 changed files with 27 additions and 31 deletions

View file

@ -39,15 +39,15 @@ class TestExtraFilePhase(helpers.PungiTestCase):
class TestCopyFiles(helpers.PungiTestCase):
@mock.patch('pungi.phases.extra_files.run')
@mock.patch('pungi.phases.extra_files.copy_all')
@mock.patch('pungi.phases.extra_files.get_file_from_scm')
@mock.patch('pungi.phases.extra_files.get_dir_from_scm')
def test_run_without_config(self, get_dir_from_scm, get_file_from_scm, run):
def test_run_without_config(self, get_dir_from_scm, get_file_from_scm, copy_all):
compose = helpers.DummyCompose(self.topdir, {})
extra_files.copy_extra_files(compose, 'x86_64', compose.variants['Server'], mock.Mock())
self.assertEqual(run.call_args_list, [])
self.assertEqual(copy_all.call_args_list, [])
self.assertEqual(get_file_from_scm.call_args_list, [])
self.assertEqual(get_dir_from_scm.call_args_list, [])