def build_centos_repos(cls, releases_paths): for repo_path in releases_paths: repo_packages = join_path(repo_path, 'Packages') utils.create_dir(repo_packages) utils.move_files_in_dir(join_path(repo_path, '*.rpm'), repo_packages) utils.exec_cmd('createrepo -o {0} {0}'.format(repo_path))
def build_centos_repos(cls, releases_paths): for repo_path in releases_paths: repo_packages = join_path(repo_path, 'Packages') utils.create_dir(repo_packages) utils.move_files_in_dir( join_path(repo_path, '*.rpm'), repo_packages) utils.exec_cmd('createrepo -o {0} {0}'.format(repo_path))
def test_move_files_in_dir(self, glob_mock, move_mock): mask = 'file*' dst_dir = '/tmp' utils.move_files_in_dir(mask, dst_dir) glob_mock.assert_called_once_with(mask) self.assertEqual(move_mock.call_args_list, [ mock.call('file1', '/tmp/file1'), mock.call('file2', '/tmp/file2') ])
def test_move_files_in_dir(self, glob_mock, move_mock): mask = 'file*' dst_dir = '/tmp' utils.move_files_in_dir(mask, dst_dir) glob_mock.assert_called_once_with(mask) self.assertEqual( move_mock.call_args_list, [mock.call('file1', '/tmp/file1'), mock.call('file2', '/tmp/file2')])