Skip to content

Commit

Permalink
Remove environment variables from the GHA workflow (#5)
Browse files Browse the repository at this point in the history
Moving them to pytest, where we can add some specific tests.

Refs: #4
  • Loading branch information
zmoog committed Nov 16, 2022
1 parent 8aed2bd commit 064d2fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ jobs:
- name: Run tests
run: |
pytest
env:
AXIOS_USERNAME: 'username'
AXIOS_PASSWORD: 'password'
AXIOS_CUSTOMER_ID: '91014810013'

12 changes: 9 additions & 3 deletions tests/test_axios.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
from axios.cli import cli


env = {
"AXIOS_USERNAME": "username",
"AXIOS_PASSWORD": "password",
"AXIOS_CUSTOMER_ID": "91014810013",
}

def test_version():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(cli, ["--version"])
result = runner.invoke(cli, ["--version"], env=env)
assert result.exit_code == 0
assert result.output.startswith("cli, version ")
assert result.exit_code == 0, result.output
Expand All @@ -21,7 +27,7 @@ def test_version():
def test_login():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(cli, ["login"])
result = runner.invoke(cli, ["login"], env=env)
assert result.exit_code == 0, result.output
assert (
"Logged in as BRANCA MAURIZIO (ISTITUTO COMPRENSIVO VEROLENGO)"
Expand All @@ -34,7 +40,7 @@ def test_login():
def test_list_grades():
runner = CliRunner()
with runner.isolated_filesystem():
result = runner.invoke(cli, ["list-grades"])
result = runner.invoke(cli, ["list-grades"], env=env)
assert result.exit_code == 0, result.output
assert (
# Click's CliRunner uses a terminal width of 80 characters, so
Expand Down

0 comments on commit 064d2fe

Please sign in to comment.