def test_localcommands_install_py_dependencies(patched_subprocess): commands = LocalCommands(Mock()) commands._install_py_dependencies(pre=True, lock=True) patched_subprocess.run.assert_any_call( ['pipenv', 'install', '--dev', '--pre'], check=True ) commands._install_py_dependencies(pre=True, lock=False) patched_subprocess.run.assert_any_call( ['pipenv', 'install', '--dev', '--pre', '--skip-lock'], check=True ) commands._install_py_dependencies(pre=False, lock=True) patched_subprocess.run.assert_any_call( ['pipenv', 'install', '--dev'], check=True ) commands._install_py_dependencies(pre=False, lock=False) patched_subprocess.run.assert_any_call( ['pipenv', 'install', '--dev', '--skip-lock'], check=True )
def test_localcommands_install(): commands = LocalCommands(fake_cli_config) commands._install_py_dependencies = Mock() commands._update_instance_path = Mock() commands._symlink_project_file_or_folder = Mock() commands.update_statics_and_assets = Mock() commands.install(False, False) commands._install_py_dependencies.assert_called_with(False, False) commands._update_instance_path.assert_called() expected_symlink_calls = [ call('invenio.cfg'), call('templates'), call('app_data') ] assert (commands._symlink_project_file_or_folder.mock_calls == expected_symlink_calls) commands.update_statics_and_assets.assert_called_with(install=True)