Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Abubakarr99 committed Aug 2, 2023
1 parent e7f24e3 commit 3130d0a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions tests/unit/models/test_settings.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
from runner_manager.models.settings import Settings

Check failure on line 1 in tests/unit/models/test_settings.py

View workflow job for this annotation

GitHub Actions / Trunk Check

black

Incorrect formatting, autoformat by running 'trunk fmt'

Check failure on line 1 in tests/unit/models/test_settings.py

View workflow job for this annotation

GitHub Actions / Trunk Check

isort

Incorrect formatting, autoformat by running 'trunk fmt'
from runner_manager.models.settings import yaml_config_settings_source
from pytest import fixture
import tempfile
import os
import yaml
from pathlib import Path


@fixture
def test_settings_default_values():
settings = Settings()
assert settings.name == "runner-manager"
assert settings.redis_om_url is None
assert settings.github_base_url is None
assert settings.redis_om_url == "redis://localhost:6379/0"
assert settings.github_base_url == "http://localhost:4010"

@fixture
def test_env_settings():
env_settings = {
"NAME": "name-test",
"REDIS_OM_URL": "redis://localhost:6379/1",
"GITHUB_BASE_URL": "http://localhost:4999",
}
settings = Settings()
settings.Config.customise_sources(env_settings=env_settings, init_settings={}, file_secret_settings={})

Check failure on line 19 in tests/unit/models/test_settings.py

View workflow job for this annotation

GitHub Actions / Trunk Check

ruff(E501)

[new] Line too long (107 > 88 characters)
assert settings.name == "name-test"
assert settings.redis_om_url == "redis://localhost:6379/1"
assert settings.github_base_url == "http://localhost:4999"

0 comments on commit 3130d0a

Please sign in to comment.