Skip to content

Commit

Permalink
tests: update dep type contains tests for pkgcraft Contains<&str> cha…
Browse files Browse the repository at this point in the history
…nges
  • Loading branch information
radhermit committed Jun 18, 2024
1 parent 03df7d3 commit 0ffc796
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions tests/dep/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ def test_contains(self):
assert UseDep("u1") not in d
assert UseDep("u") not in d

# substrings
assert "u2?" in d
assert "b ) )" in d
assert "z" not in d
# stringified, flattened values
assert "a" in d
assert "b" in d
assert "( b )" not in d

# non-Dependency objects return False
assert None not in d
# all other object types return False
for obj in (None, object()):
assert obj not in d

def test_iter(self):
assert list(Dependency.required_use("a")) == []
Expand Down Expand Up @@ -434,15 +435,15 @@ def test_contains(self):
assert UseDep("u1") not in d
assert UseDep("u") not in d

# substrings
# stringified, flattened values
assert "a/b" in d
assert "u2? ( b/c )" in d
assert "u2?" in d
assert " ( " in d
assert "z" not in d
assert "c/d" in d
assert "u2? ( b/c )" not in d
assert "u2?" not in d

# all other object types return False
assert None not in d
for obj in (None, object()):
assert obj not in d

def test_eq_and_hash(self):
# ordering that doesn't matter for equivalence and hashing
Expand Down

0 comments on commit 0ffc796

Please sign in to comment.