Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 8, 2024
1 parent e34bf0f commit 5e7ab62
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,23 +493,24 @@ class A:
job.doc = {key: "test"}

def test_statepoint_mapping_read_only(self):
statepoint = {'a': 0, 'b': 1, 'dict': {'value': 'string'}}
statepoint = {"a": 0, "b": 1, "dict": {"value": "string"}}
job = self.open_job(statepoint=statepoint)
job.init()

assert 'a' in job.statepoint_mapping
assert 'b' in job.statepoint_mapping
assert 'c' not in job.statepoint_mapping
assert 'dict' in job.statepoint_mapping
assert job.statepoint_mapping['a'] == 0
assert job.statepoint_mapping['b'] == 1
assert job.statepoint_mapping['dict'] == {'value': 'string'}
assert "a" in job.statepoint_mapping
assert "b" in job.statepoint_mapping
assert "c" not in job.statepoint_mapping
assert "dict" in job.statepoint_mapping
assert job.statepoint_mapping["a"] == 0
assert job.statepoint_mapping["b"] == 1
assert job.statepoint_mapping["dict"] == {"value": "string"}
with pytest.raises(KeyError):
job.statepoint_mapping['c']
assert list(job.statepoint_mapping.keys()) == ['a', 'b', 'dict']
job.statepoint_mapping["c"]
assert list(job.statepoint_mapping.keys()) == ["a", "b", "dict"]

with pytest.raises(TypeError):
job.statepoint_mapping['c'] = 2
job.statepoint_mapping["c"] = 2


class TestConfig(TestJobBase):
def test_config_str(self):
Expand Down

0 comments on commit 5e7ab62

Please sign in to comment.