Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Mar 18, 2023
1 parent 306d464 commit e0861f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions jsonargparse_tests/test_alias.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def test_alias():
import jsonargparse
parser = jsonargparse.ArgumentParser()
parser.add_argument('--foo', '--bar')
parsed = parser.parse_string('foo: "aaa"')
assert parsed.foo == 'aaa'
parsed = parser.parse_string('bar: "bbb"')
assert parsed.foo == 'bbb'
parsed = parser.parse_args(['--bar', 'ccc'])
assert parsed.foo == 'ccc'

0 comments on commit e0861f3

Please sign in to comment.