Skip to content

Commit

Permalink
Extraxt env variable from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BraunRudolf committed Sep 8, 2024
1 parent 23811fc commit 054e6e2
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions tests/api_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
]
}

envs = {
"ENPHASE_CLIENT_ID": "1",
"ENPHASE_SYSTEM_ID": "1",
"ENPHASE_API_KEY": "test_key",
"ENPHASE_CLIENT_SECRET": "secret_secret",
}


@pytest.fixture
def client():
Expand Down Expand Up @@ -143,12 +150,6 @@ def test_api_wrong_body(client, body_wrong):

def test_getenphse_authorization_url(client, monkeypatch):

envs = {
"ENPHASE_CLIENT_ID": "1",
"ENPHASE_SYSTEM_ID": "1",
"ENPHASE_API_KEY": "test_key",
"ENPHASE_CLIENT_SECRET": "secret_secret",
}
monkeypatch.setattr(os, "environ", envs)

response = client.get("/solar_inverters/enphase/auth_url")
Expand All @@ -158,12 +159,6 @@ def test_getenphse_authorization_url(client, monkeypatch):

def test_getenphse_token_and_system_id_bad_redirect_url(client, bad_redirect_url, monkeypatch):

envs = {
"ENPHASE_CLIENT_ID": "1",
"ENPHASE_SYSTEM_ID": "1",
"ENPHASE_API_KEY": "test_key",
"ENPHASE_CLIENT_SECRET": "secret_secret",
}
monkeypatch.setattr(os, "environ", envs)

response = client.post(
Expand All @@ -178,12 +173,6 @@ def test_getenphse_token_and_system_id_bad_redirect_url(
client, bad_redirect_url_correct_param, monkeypatch
):

envs = {
"ENPHASE_CLIENT_ID": "1",
"ENPHASE_SYSTEM_ID": "1",
"ENPHASE_API_KEY": "test_key",
"ENPHASE_CLIENT_SECRET": "secret_secret",
}
monkeypatch.setattr(os, "environ", envs)

response = client.post(
Expand Down

0 comments on commit 054e6e2

Please sign in to comment.