Skip to content

test(general): Add some missing code coverage #296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 3, 2021
3 changes: 3 additions & 0 deletions tests/functional/test_lambda_trigger_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def message(self) -> str:

assert DataClassSample(data1) == DataClassSample(data1)
assert DataClassSample(data1) != DataClassSample(data2)
# Comparing against a dict should not be equals
assert DataClassSample(data1) != data1
assert data1 != DataClassSample(data1)
assert DataClassSample(data1) is not data1
assert data1 is not DataClassSample(data1)

Expand Down
26 changes: 26 additions & 0 deletions tests/functional/test_utilities_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1534,6 +1534,32 @@ def _get_multiple(self, path: str, **kwargs) -> Dict[str, str]:
assert str_value == json.dumps(mock_body_json)


def test_appconf_get_app_config_new(monkeypatch, mock_name, mock_value):
# GIVEN
class TestProvider(BaseProvider):
def __init__(self, environment: str, application: str):
super().__init__()

def get(self, name: str, **kwargs) -> str:
return mock_value

def _get(self, name: str, **kwargs) -> str:
raise NotImplementedError()

def _get_multiple(self, path: str, **kwargs) -> Dict[str, str]:
raise NotImplementedError()

monkeypatch.setattr(parameters.appconfig, "DEFAULT_PROVIDERS", {})
monkeypatch.setattr(parameters.appconfig, "AppConfigProvider", TestProvider)

# WHEN
value = parameters.get_app_config(mock_name, environment="dev", application="myapp")

# THEN
assert parameters.appconfig.DEFAULT_PROVIDERS["appconfig"] is not None
assert value == mock_value


def test_transform_value_json(mock_value):
"""
Test transform_value() with a json transform
Expand Down