Skip to content

Commit

Permalink
make black happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Caha committed Mar 20, 2024
1 parent edfb358 commit 62ee904
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
License: MIT
"""

import pytest

from config import config, ConfigError, validate_config
Expand Down Expand Up @@ -63,37 +64,27 @@ def test_config():
validate_config(config)

_reset_config()
with pytest.raises(
ConfigError, match="Config error: Incorrect Local driver settings"
):
with pytest.raises(ConfigError, match="Config error: Incorrect Local driver settings"):
config.update({"DRIVER": "local", "LOCAL__DEST": None})
validate_config(config)

_reset_config()
with pytest.raises(
ConfigError, match="Config error: Incorrect MinIO driver settings"
):
with pytest.raises(ConfigError, match="Config error: Incorrect MinIO driver settings"):
config.update({"DRIVER": "minio", "MINIO__ENDPOINT": None})
validate_config(config)

_reset_config()
with pytest.raises(
ConfigError, match="Config error: Allowed extensions can not be empty"
):
with pytest.raises(ConfigError, match="Config error: Allowed extensions can not be empty"):
config.update({"ALLOWED_EXTENSIONS": []})
validate_config(config)

_reset_config()
with pytest.raises(
ConfigError, match="Config error: References list can not be empty"
):
with pytest.raises(ConfigError, match="Config error: References list can not be empty"):
config.update({"REFERENCES": []})
validate_config(config)

_reset_config()
with pytest.raises(
ConfigError, match="Config error: Incorrect media reference settings"
):
with pytest.raises(ConfigError, match="Config error: Incorrect media reference settings"):
config.update({"REFERENCES": [{"file": "survey.gpkg"}]})
validate_config(config)

Expand Down

0 comments on commit 62ee904

Please sign in to comment.