mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette install -r requirements.txt, closes #2033
This commit is contained in:
parent
a53b893c46
commit
1ad92a1d87
4 changed files with 44 additions and 6 deletions
|
|
@ -178,6 +178,24 @@ def test_install_upgrade(run_module, flag):
|
|||
assert sys.argv == ["pip", "install", "--upgrade", "datasette"]
|
||||
|
||||
|
||||
@mock.patch("datasette.cli.run_module")
|
||||
def test_install_requirements(run_module):
|
||||
runner = CliRunner()
|
||||
with runner.isolated_filesystem():
|
||||
with open("requirements.txt", "w") as fp:
|
||||
fp.write("datasette-mock-plugin\ndatasette-plugin-2")
|
||||
runner.invoke(cli, ["install", "-r", "requirements.txt"])
|
||||
run_module.assert_called_once_with("pip", run_name="__main__")
|
||||
assert sys.argv == ["pip", "install", "-r", "requirements.txt"]
|
||||
|
||||
|
||||
def test_install_error_if_no_packages():
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["install"])
|
||||
assert result.exit_code == 2
|
||||
assert "Error: Please specify at least one package to install" in result.output
|
||||
|
||||
|
||||
@mock.patch("datasette.cli.run_module")
|
||||
def test_uninstall(run_module):
|
||||
runner = CliRunner()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue