Skip to content

Commit

Permalink
Fix unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraham authored and moz-wptsync-bot committed Jul 31, 2023
1 parent b7cf1dc commit 490feeb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions tools/wptrunner/wptrunner/tests/test_testloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,14 +248,14 @@ def test_loader_filter_tags():
loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None)
assert len(loader.tests["testharness"]) == 4

# Check: specifying a single `test-include` inclusion yields `/a/bar`
# Check: specifying a single `test-include` inclusion yields `/a/bar` and `/b/baz`
loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
test_filters=[TagFilter({"test-include"})])
assert len(loader.tests["testharness"]) == 1
test_filters=[TagFilter({"test-include"}, {})])
assert len(loader.tests["testharness"]) == 2
assert loader.tests["testharness"][0].id == "/a/bar.html"
assert loader.tests["testharness"][0].tags == {"dir:a", "test-include"}
assert loader.tests["testharness"][1].id == "/b/baz.html"
assert loader.tests["testharness"][1].tags == {"dir:b", "test-include"}
assert loader.tests["testharness"][1].tags == {"dir:b", "test-include", "test-exclude"}

# Check: specifying a single `test-exclude` exclusion rejects only `/b/baz`
loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
Expand All @@ -274,13 +274,11 @@ def test_loader_filter_tags():

loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
test_filters=[TagFilter({"test-include"}, {"test-include"})])
assert (len(loader.tests["testharness"] == 0))
assert len(loader.tests["testharness"]) == 0

loader = TestLoader({manifest: {"metadata_path": metadata_path}}, ["testharness"], None,
test_filters=[TagFilter({"test-include", "test-exclude"}, {"test-include"})])
assert len(loader.tests["testharness"]) == 1
assert loader.tests["testharness"][0].id == "/b/baz.html"
assert loader.tests["testharness"][0].tags == {"dir:b", "test-include", "test-exclude"}
assert len(loader.tests["testharness"]) == 0


def test_chunk_hash(manifest):
Expand Down

0 comments on commit 490feeb

Please sign in to comment.