Skip to content

Commit

Permalink
uncomment tests in test_set
Browse files Browse the repository at this point in the history
  • Loading branch information
sezanzeb committed Jan 4, 2025
1 parent 62e1f36 commit 509bb1e
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions tests/unit/test_macros/test_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,33 @@ async def test_set_key(self):
)

async def test_set(self):
"""await Parser.parse('set(a, "foo")', self.context, DummyMapping).run(self.handler)
await Parser.parse(
'set(a, "foo")',
self.context,
DummyMapping,
).run(self.handler)
self.assertEqual(macro_variables.get("a"), "foo")

await Parser.parse('set( \t"b" \n, "1")', self.context, DummyMapping).run(self.handler)
self.assertEqual(macro_variables.get("b"), "1")"""
await Parser.parse(
'set( \t"b" \n, "1")',
self.context,
DummyMapping,
).run(self.handler)
self.assertEqual(macro_variables.get("b"), "1")

await Parser.parse("set(a, 1)", self.context, DummyMapping).run(self.handler)
await Parser.parse(
"set(a, 1)",
self.context,
DummyMapping,
).run(self.handler)
self.assertEqual(macro_variables.get("a"), 1)

"""await Parser.parse("set(a, )", self.context, DummyMapping).run(self.handler)
self.assertEqual(macro_variables.get("a"), None)"""
await Parser.parse(
"set(a, )",
self.context,
DummyMapping,
).run(self.handler)
self.assertEqual(macro_variables.get("a"), None)

async def test_raises_error(self):
self.assertRaises(MacroError, Parser.parse, "set($a, 1)", self.context)
Expand Down

0 comments on commit 509bb1e

Please sign in to comment.