Skip to content

Commit

Permalink
chore: remove unused Config.is_valid(); just test Config.load()
Browse files Browse the repository at this point in the history
  • Loading branch information
cfm committed Mar 7, 2024
1 parent 3fbed5f commit 2e0ae4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 0 additions & 4 deletions client/securedrop_client/config.py
Expand Up @@ -42,7 +42,3 @@ def load(self) -> "Config":
setattr(config, store, value)

return config

@property
def is_valid(self) -> bool:
return self.journalist_key_fingerprint is not None
8 changes: 4 additions & 4 deletions client/tests/test_config.py
Expand Up @@ -4,12 +4,12 @@
from securedrop_client.config import Config


@patch.dict(os.environ, {"SD_SUBMISSION_KEY_FPR": ""})
def test_missing_journalist_key_fpr():
@patch.dict(os.environ, {"SD_SUBMISSION_KEY_FPR": "foobar"})
def test_config():
"""
If a key is missing, the config can still be loaded, but is "invalid".
"""
config = Config.load()

assert config.journalist_key_fingerprint is None
assert config.is_valid is False
assert config.journalist_key_fingerprint == "foobar"
assert config.gpg_domain is None

0 comments on commit 2e0ae4c

Please sign in to comment.