mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette install / datasette uninstall commands, closes #925
This commit is contained in:
parent
3fa261d1d2
commit
01fe5b7401
3 changed files with 58 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import json
|
|||
import pathlib
|
||||
import pytest
|
||||
import textwrap
|
||||
from unittest import mock
|
||||
|
||||
|
||||
def test_inspect_cli(app_client):
|
||||
|
|
@ -107,3 +108,19 @@ def test_metadata_yaml():
|
|||
client.ds = ds
|
||||
response = client.get("/-/metadata.json")
|
||||
assert {"title": "Hello from YAML"} == response.json
|
||||
|
||||
|
||||
@mock.patch("pip._internal.cli.main.main")
|
||||
def test_install(main):
|
||||
runner = CliRunner()
|
||||
runner.invoke(cli, ["install", "datasette-mock-plugin", "datasette-mock-plugin2"])
|
||||
main.assert_called_once_with(
|
||||
["install", "datasette-mock-plugin", "datasette-mock-plugin2"]
|
||||
)
|
||||
|
||||
|
||||
@mock.patch("pip._internal.cli.main.main")
|
||||
def test_uninstall(main):
|
||||
runner = CliRunner()
|
||||
runner.invoke(cli, ["uninstall", "datasette-mock-plugin", "-y"])
|
||||
main.assert_called_once_with(["uninstall", "datasette-mock-plugin", "-y"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue