Skip to content

Commit e0861f3

Browse files
committed
Add test
1 parent 306d464 commit e0861f3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jsonargparse_tests/test_alias.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
def test_alias():
2+
import jsonargparse
3+
parser = jsonargparse.ArgumentParser()
4+
parser.add_argument('--foo', '--bar')
5+
parsed = parser.parse_string('foo: "aaa"')
6+
assert parsed.foo == 'aaa'
7+
parsed = parser.parse_string('bar: "bbb"')
8+
assert parsed.foo == 'bbb'
9+
parsed = parser.parse_args(['--bar', 'ccc'])
10+
assert parsed.foo == 'ccc'

0 commit comments

Comments
 (0)