Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Li <[email protected]>
  • Loading branch information
wyli committed Sep 7, 2023
1 parent 5158fbf commit 97ebf2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ def test_builtin(self):
config = {"import statements": "$import math", "calc": {"_target_": "math.isclose", "a": 0.001, "b": 0.001}}
self.assertEqual(ConfigParser(config).calc, True)

def test_slicing(self):
config = {"test": [1, 2, 3, 4], "test1": "$@test[::]", "test2": "$@test[::-1]", "st": "aten::relu"}
self.assertEqual(ConfigParser(config).test1, [1, 2, 3, 4])
self.assertEqual(ConfigParser(config).test2, [4, 3, 2, 1])
self.assertEqual(ConfigParser(config).st, "aten::relu")

@parameterized.expand([TEST_CASE_5])
def test_substring_reference(self, config, expected):
parser = ConfigParser(config=config)
Expand Down

0 comments on commit 97ebf2e

Please sign in to comment.