mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
parent
371170eee8
commit
98632f0a87
12 changed files with 58 additions and 14 deletions
|
|
@ -15,7 +15,7 @@ FROM python:3.8
|
|||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
ENV DATASETTE_SECRET 'sekrit'
|
||||
RUN pip install -U datasette
|
||||
RUN datasette inspect test.db --inspect-file inspect-data.json
|
||||
ENV PORT {port}
|
||||
|
|
@ -33,7 +33,7 @@ def test_package(mock_call, mock_which):
|
|||
mock_call.side_effect = capture
|
||||
with runner.isolated_filesystem():
|
||||
open("test.db", "w").write("data")
|
||||
result = runner.invoke(cli.cli, ["package", "test.db"])
|
||||
result = runner.invoke(cli.cli, ["package", "test.db", "--secret", "sekrit"])
|
||||
assert 0 == result.exit_code
|
||||
mock_call.assert_has_calls([mock.call(["docker", "build", "."])])
|
||||
assert EXPECTED_DOCKERFILE.format(port=8001) == capture.captured
|
||||
|
|
@ -48,6 +48,8 @@ def test_package_with_port(mock_call, mock_which):
|
|||
runner = CliRunner()
|
||||
with runner.isolated_filesystem():
|
||||
open("test.db", "w").write("data")
|
||||
result = runner.invoke(cli.cli, ["package", "test.db", "-p", "8080"])
|
||||
result = runner.invoke(
|
||||
cli.cli, ["package", "test.db", "-p", "8080", "--secret", "sekrit"]
|
||||
)
|
||||
assert 0 == result.exit_code
|
||||
assert EXPECTED_DOCKERFILE.format(port=8080) == capture.captured
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue