datasette publish cloudrun (#434) - thanks, @rprimet

New publish subcommand that publishes using the
new Google Cloud Run platform.

    datasette publish cloudrun database.db
This commit is contained in:
Romain Primet 2019-05-03 15:59:01 +02:00 committed by Simon Willison
commit 75a21fc2a1
5 changed files with 152 additions and 13 deletions

View file

@ -256,6 +256,29 @@ def test_temporary_docker_directory_uses_copy_if_hard_link_fails(mock_link):
assert 1 == os.stat(hello).st_nlink
def test_temporary_docker_directory_quotes_args():
with tempfile.TemporaryDirectory() as td:
os.chdir(td)
open('hello', 'w').write('world')
with utils.temporary_docker_directory(
files=['hello'],
name='t',
metadata=None,
extra_options='--$HOME',
branch=None,
template_dir=None,
plugins_dir=None,
static=[],
install=[],
spatialite=False,
version_note='$PWD',
) as temp_docker:
df = os.path.join(temp_docker, 'Dockerfile')
df_contents = open(df).read()
assert "'$PWD'" in df_contents
assert "'--$HOME'" in df_contents
def test_compound_keys_after_sql():
assert '((a > :p0))' == utils.compound_keys_after_sql(['a'])
assert '''