Skip to content

Commit

Permalink
update test get envvar
Browse files Browse the repository at this point in the history
  • Loading branch information
CharleyDL committed May 2, 2024
1 parent 630b36d commit e53ace3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pymdown-extensions==10.7.1
pyparsing==3.1.1
PySocks==1.7.1
pytest==8.1.1
python-dotenv==1.0.1
python-dateutil==2.8.2
pytz==2023.3.post1
PyYAML==6.0.1
Expand Down
6 changes: 0 additions & 6 deletions tests/pytest.ini

This file was deleted.

32 changes: 23 additions & 9 deletions tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@

import os

from dotenv import load_dotenv

class TestLoadModel:

load_dotenv()


class TestEnvVar:

def test_get_envvar(self):
print("Valeur de 'API_URL' dans l'environnement:", os.getenv('API_URL'))
print("Valeur de 'DAGSHUB_REPO_OWNER' dans l'environnement:", os.getenv('DAGSHUB_REPO_OWNER'))
print("Valeur de 'DAGSHUB_REPO' dans l'environnement:", os.getenv('DAGSHUB_REPO'))
print("Valeur de 'MODEL_URI' dans l'environnement:", os.getenv('MODEL_URI'))
api_url = os.getenv('API_URL')
dagshub_repo_owner = os.getenv('DAGSHUB_REPO_OWNER')
dagshub_repo = os.getenv('DAGSHUB_REPO')
model_uri = os.getenv('MODEL_URI')

print(f"API URL: {api_url}")
print(f"Dagshub Repo Owner: {dagshub_repo_owner}")
print(f"Dagshub Repo: {dagshub_repo}")
print(f"Model URI: {model_uri}")

assert api_url is not None
assert dagshub_repo_owner is not None
assert dagshub_repo is not None
assert model_uri is not None


assert os.getenv('API_URL') is not None
assert os.getenv('DAGSHUB_REPO_OWNER') is not None
assert os.getenv('DAGSHUB_REPO') is not None
assert os.getenv('MODEL_URI') is not None


# class TestLoadModel:

# def test_load_model(self):
# model = load_model()
# assert model is not None
Expand Down

0 comments on commit e53ace3

Please sign in to comment.