Skip to content

Commit

Permalink
fix nebari invocation through python (#1711)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeier authored Apr 24, 2023
1 parent 0a70b25 commit 37226b7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nebari/__main__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import sys

from nebari.cli import cli
from nebari.cli.main import app


def main():
cli(sys.argv[1:])
app(sys.argv[1:])


if __name__ == "__main__":
Expand Down
14 changes: 14 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,17 @@ def test_nebari_init(tmp_path, namespace, auth_provider, ci_provider, ssl_cert_e
assert acme_email.get("acme_email") == ssl_cert_email
else:
assert acme_email == ssl_cert_email


def test_python_invocation():
def run(command):
return subprocess.run(
command, check=True, capture_output=True, text=True
).stdout.strip()

command = ["nebari", "--version"]

actual = run(["python", "-m", *command])
expected = run(command)

assert actual == expected

0 comments on commit 37226b7

Please sign in to comment.