Skip to content

Commit

Permalink
Expand test
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted committed Oct 11, 2023
1 parent 7b91d95 commit e514b48
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions tests/utils/test_environment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
from collections.abc import ItemsView, KeysView, ValuesView
from unittest.mock import ANY

import pytest
Expand Down Expand Up @@ -37,10 +38,15 @@ def test_update_os_environ(environment: Environment):
assert "TEST" in environment
assert environment["TEST"] == "test"
keys = environment.keys()
assert isinstance(keys, KeysView)
assert "TEST" in keys
assert "test" in environment.values()
items = dict(environment.items())
assert items["TEST"] == "test"
values = environment.values()
assert isinstance(values, ValuesView)
assert "test" in values
items = environment.items()
assert isinstance(items, ItemsView)
d = dict(items)
assert d["TEST"] == "test"


def test_mapping():
Expand All @@ -65,3 +71,11 @@ def test_dict(environment: Environment):
"ENVIRONMENT": "here",
"PYTEST_CURRENT_TEST": ANY,
}


def test_dict_unpacking(environment: Environment):
assert {**environment} == {
"MY": "fake",
"ENVIRONMENT": "here",
"PYTEST_CURRENT_TEST": ANY,
}

0 comments on commit e514b48

Please sign in to comment.