Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mudit2812 committed Jan 9, 2025
1 parent 378fc18 commit f1739ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/data/attributes/operator/test__wires.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class TestWiresToJson:
((0, 1, 2), "[0, 1, 2]"),
(range(3), "[0, 1, 2]"),
(["a", "b"], '["a", "b"]'),
([0, 1, None], "[0, 1, null]"),
(["a", 1, None], '["a", 1, null]'),
([0, 1], "[0, 1]"),
(["a", 1], '["a", 1]'),
(1, "[1]"),
("a", '["a"]'),
(np.int64(1), "[1]"),
Expand Down
3 changes: 3 additions & 0 deletions tests/test_wires.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def test_error_if_wires_none(self):
with pytest.raises(TypeError, match="Must specify a set of wires."):
Wires(None)

with pytest.raises(TypeError, match="Must specify a set of wires."):
Wires([None, 1])

@pytest.mark.parametrize("iterable", [np.array([0, 1, 2]), [0, 1, 2], (0, 1, 2), range(3)])
def test_creation_from_common_iterables(self, iterable):
"""Tests that a Wires object can be created from standard iterable inputs."""
Expand Down

0 comments on commit f1739ef

Please sign in to comment.