Lines Matching refs:NS
68 class NS(object):
270 ('', NS(x=None)),
271 ('-x a', NS(x='a')),
272 ('-xa', NS(x='a')),
273 ('-x -1', NS(x='-1')),
274 ('-x-1', NS(x='-1')),
289 ('', NS(x=False, yyy=None, z=None)),
290 ('-x', NS(x=True, yyy=None, z=None)),
291 ('-za', NS(x=False, yyy=None, z='a')),
292 ('-z a', NS(x=False, yyy=None, z='a')),
293 ('-xza', NS(x=True, yyy=None, z='a')),
294 ('-xz a', NS(x=True, yyy=None, z='a')),
295 ('-x -za', NS(x=True, yyy=None, z='a')),
296 ('-x -z a', NS(x=True, yyy=None, z='a')),
297 ('-y', NS(x=False, yyy=42, z=None)),
298 ('-yyy', NS(x=False, yyy=42, z=None)),
299 ('-x -yyy -za', NS(x=True, yyy=42, z='a')),
300 ('-x -yyy -z a', NS(x=True, yyy=42, z='a')),
310 ('', NS(foo=None)),
311 ('-foo a', NS(foo='a')),
312 ('-foo -1', NS(foo='-1')),
313 ('-fo a', NS(foo='a')),
314 ('-f a', NS(foo='a')),
324 ('', NS(f=None, foobar=None, foorab=None)),
325 ('-f a', NS(f='a', foobar=None, foorab=None)),
326 ('-fa', NS(f='a', foobar=None, foorab=None)),
327 ('-foa', NS(f='oa', foobar=None, foorab=None)),
328 ('-fooa', NS(f='ooa', foobar=None, foorab=None)),
329 ('-foobar a', NS(f=None, foobar='a', foorab=None)),
330 ('-foorab a', NS(f=None, foobar=None, foorab='a')),
340 ('', NS(foobar=None, foorab=None)),
341 ('-foob a', NS(foobar='a', foorab=None)),
342 ('-foor a', NS(foobar=None, foorab='a')),
343 ('-fooba a', NS(foobar='a', foorab=None)),
344 ('-foora a', NS(foobar=None, foorab='a')),
345 ('-foobar a', NS(foobar='a', foorab=None)),
346 ('-foorab a', NS(foobar=None, foorab='a')),
356 ('', NS(one=None)),
357 ('-1 a', NS(one='a')),
358 ('-1a', NS(one='a')),
359 ('-1-2', NS(one='-2')),
369 ('', NS(foo=None)),
370 ('--foo a', NS(foo='a')),
371 ('--foo=a', NS(foo='a')),
372 ('--foo -2.5', NS(foo='-2.5')),
373 ('--foo=-2.5', NS(foo='-2.5')),
386 ('', NS(badger=False, bat=None)),
387 ('--bat X', NS(badger=False, bat='X')),
388 ('--bad', NS(badger=True, bat=None)),
389 ('--badg', NS(badger=True, bat=None)),
390 ('--badge', NS(badger=True, bat=None)),
391 ('--badger', NS(badger=True, bat=None)),
404 ('', NS(badger=False, ba=None)),
405 ('--ba X', NS(badger=False, ba='X')),
406 ('--ba=X', NS(badger=False, ba='X')),
407 ('--bad', NS(badger=True, ba=None)),
408 ('--badg', NS(badger=True, ba=None)),
409 ('--badge', NS(badger=True, ba=None)),
410 ('--badger', NS(badger=True, ba=None)),
424 ('', NS(f=False, bar=None, baz=None)),
425 ('-f', NS(f=True, bar=None, baz=None)),
426 ('--ba B', NS(f=False, bar='B', baz=None)),
427 ('-f --bar B', NS(f=True, bar='B', baz=None)),
428 ('-f -b', NS(f=True, bar=None, baz=42)),
429 ('-ba -f', NS(f=True, bar=None, baz=42)),
444 ('', NS(f=False, bar=None, baz=None)),
445 ('+f', NS(f=True, bar=None, baz=None)),
446 ('::ba B', NS(f=False, bar='B', baz=None)),
447 ('+f ::bar B', NS(f=True, bar='B', baz=None)),
448 ('+f /b', NS(f=True, bar=None, baz=42)),
449 ('/ba +f', NS(f=True, bar=None, baz=42)),
466 ('', NS(f=False, bar=None, baz=None)),
467 ('+f', NS(f=True, bar=None, baz=None)),
468 ('::ba B', NS(f=False, bar='B', baz=None)),
469 ('+f ::bar B', NS(f=True, bar='B', baz=None)),
470 ('+f /b', NS(f=True, bar=None, baz=42)),
471 ('/ba +f', NS(f=True, bar=None, baz=42))
491 ('', NS(x=False, y=False, z=False)),
492 ('-x', NS(x=True, y=False, z=False)),
493 ('+y -x', NS(x=True, y=True, z=False)),
494 ('+yz -x', NS(x=True, y=True, z=True)),
506 ('', NS(verbose=False)),
507 ('-v', NS(verbose=True)),
508 ('--verbose', NS(verbose=True)),
509 ('-n', NS(verbose=True)),
510 ('--noisy', NS(verbose=True)),
520 ('--foo-bar f', NS(foo_bar='f', zabbaz=None)),
521 ('--baz g', NS(foo_bar=None, zabbaz='g')),
522 ('--foo-bar h --baz i', NS(foo_bar='h', zabbaz='i')),
523 ('--baz j --foo-bar k', NS(foo_bar='k', zabbaz='j')),
533 ('', NS(x=None, y=42)),
534 ('-xx', NS(x='x', y=42)),
535 ('-yy', NS(x=None, y='y')),
545 ('', NS(x=None)),
546 ('-x a', NS(x='a')),
556 ('', NS(x=None)),
557 ('-x a', NS(x=['a'])),
567 ('', NS(x=None)),
568 ('-x a b c', NS(x=['a', 'b', 'c'])),
583 ('', NS(w=None, x=None, y='spam', z=84)),
584 ('-w', NS(w=None, x=None, y='spam', z=84)),
585 ('-w 2', NS(w='2', x=None, y='spam', z=84)),
586 ('-x', NS(w=None, x=42, y='spam', z=84)),
587 ('-x 2', NS(w=None, x='2', y='spam', z=84)),
588 ('-y', NS(w=None, x=None, y=None, z=84)),
589 ('-y 2', NS(w=None, x=None, y='2', z=84)),
590 ('-z', NS(w=None, x=None, y='spam', z=42)),
591 ('-z 2', NS(w=None, x=None, y='spam', z=2)),
604 ('', NS(x=None, y='spam')),
605 ('-x', NS(x=[], y='spam')),
606 ('-x a', NS(x=['a'], y='spam')),
607 ('-x a b', NS(x=['a', 'b'], y='spam')),
608 ('-y', NS(x=None, y=[])),
609 ('-y a', NS(x=None, y=['a'])),
610 ('-y a b', NS(x=None, y=['a', 'b'])),
623 ('', NS(x=None, y='spam')),
624 ('-x a', NS(x=['a'], y='spam')),
625 ('-x a b', NS(x=['a', 'b'], y='spam')),
626 ('-y a', NS(x=None, y=['a'])),
627 ('-y a b', NS(x=None, y=['a', 'b'])),
639 ('', NS(f=None, g=None)),
640 ('-f a', NS(f='a', g=None)),
641 ('-f c', NS(f='c', g=None)),
642 ('-g 0', NS(f=None, g=0)),
643 ('-g 03', NS(f=None, g=3)),
644 ('-fb -g4', NS(f='b', g=4)),
656 ('-x 1', NS(x=1)),
657 ('-x42', NS(x=42)),
667 ('', NS(x=None)),
668 ('-xfoo', NS(x='foo')),
678 ('', NS(y=None)),
679 ('-y', NS(y=object)),
689 ('', NS(z=True)),
690 ('-z', NS(z=False)),
700 ('', NS(apple=False)),
701 ('--apple', NS(apple=True)),
711 ('', NS(baz=None)),
712 ('--baz a', NS(baz=['a'])),
713 ('--baz a --baz b', NS(baz=['a', 'b'])),
723 ('', NS(baz=['X'])),
724 ('--baz a', NS(baz=['X', 'a'])),
725 ('--baz a --baz b', NS(baz=['X', 'a', 'b'])),
738 ('', NS(b=None)),
739 ('-b', NS(b=[Exception])),
740 ('-b -cx -b -cyz', NS(b=[Exception, 'x', Exception, 'yz'])),
753 ('', NS(b=['X'])),
754 ('-b', NS(b=['X', Exception])),
755 ('-b -cx -b -cyz', NS(b=['X', Exception, 'x', Exception, 'yz'])),
765 ('', NS(x=None)),
766 ('-x', NS(x=1)),
780 ('a', NS(foo='a')),
790 ('a', NS(foo=['a'])),
800 ('a b', NS(foo=['a', 'b'])),
810 ('', NS(foo=[])),
811 ('a', NS(foo=['a'])),
812 ('a b', NS(foo=['a', 'b'])),
822 ('', NS(foo='bar')),
823 ('a', NS(foo=['a'])),
824 ('a b', NS(foo=['a', 'b'])),
834 ('a', NS(foo=['a'])),
835 ('a b', NS(foo=['a', 'b'])),
845 ('', NS(foo=None)),
846 ('a', NS(foo='a')),
856 ('', NS(foo=42)),
857 ('a', NS(foo='a')),
871 ('', NS(foo=42)),
872 ('1', NS(foo=1)),
882 ('a b', NS(foo='a', bar='b')),
892 ('a b', NS(foo='a', bar=['b'])),
902 ('a b c', NS(foo=['a', 'b'], bar='c')),
912 ('a', NS(foo='a', bar=[])),
913 ('a b', NS(foo='a', bar=['b'])),
914 ('a b c', NS(foo='a', bar=['b', 'c'])),
924 ('a b', NS(foo='a', bar=['b'])),
925 ('a b c', NS(foo='a', bar=['b', 'c'])),
935 ('a', NS(foo='a', bar=None)),
936 ('a b', NS(foo='a', bar='b')),
946 ('a', NS(foo=[], bar='a')),
947 ('a b', NS(foo=['a'], bar='b')),
948 ('a b c', NS(foo=['a', 'b'], bar='c')),
958 ('a b', NS(foo=['a'], bar='b')),
959 ('a b c', NS(foo=['a', 'b'], bar='c')),
969 ('a', NS(foo=42, bar='a')),
970 ('a b', NS(foo='a', bar='b')),
980 ('a b', NS(foo=['a', 'b'], bar=[])),
981 ('a b c', NS(foo=['a', 'b'], bar=['c'])),
991 ('a b c', NS(foo=['a', 'b'], bar=['c'])),
1001 ('a b', NS(foo=['a', 'b'], bar=None)),
1002 ('a b c', NS(foo=['a', 'b'], bar='c')),
1012 ('a', NS(foo=[], bar=['a'])),
1013 ('a b', NS(foo=['a'], bar=['b'])),
1014 ('a b c', NS(foo=['a', 'b'], bar=['c'])),
1024 ('a b', NS(foo=['a'], bar=['b'])),
1025 ('a b c', NS(foo=['a', 'b'], bar=['c'])),
1035 ('a', NS(foo=None, bar=['a'])),
1036 ('a b', NS(foo='a', bar=['b'])),
1050 ('a b', NS(foo='a', bar=[], baz=['b'])),
1051 ('a b c', NS(foo='a', bar=['b'], baz=['c'])),
1065 ('a b c', NS(foo='a', bar=['b'], baz=['c'])),
1066 ('a b c d', NS(foo='a', bar=['b', 'c'], baz=['d'])),
1080 ('a b', NS(foo='a', bar=0.625, baz=['b'])),
1081 ('a b c', NS(foo='a', bar='b', baz=['c'])),
1094 ('', NS(foo=None, bar=42)),
1095 ('a', NS(foo='a', bar=42)),
1096 ('a b', NS(foo='a', bar='b')),
1106 ('', NS(foo=None, bar=[])),
1107 ('a', NS(foo='a', bar=[])),
1108 ('a b', NS(foo='a', bar=['b'])),
1109 ('a b c', NS(foo='a', bar=['b', 'c'])),
1119 ('a', NS(foo=None, bar=['a'])),
1120 ('a b', NS(foo='a', bar=['b'])),
1121 ('a b c', NS(foo='a', bar=['b', 'c'])),
1131 ('a', NS(spam='a')),
1132 ('g', NS(spam='g')),
1142 ('4', NS(spam=4)),
1143 ('15', NS(spam=15)),
1156 ('a b c', NS(spam=['a', ['b', 'c']])),
1172 ('', NS(x=None, y=False)),
1173 ('a', NS(x='a', y=False)),
1174 ('-4', NS(x=None, y=True)),
1175 ('-4 a', NS(x='a', y=True)),
1188 ('', NS(x=None, y=False)),
1189 ('-2', NS(x='-2', y=False)),
1190 ('a', NS(x='a', y=False)),
1191 ('-k4', NS(x=None, y=True)),
1192 ('-k4 a', NS(x='a', y=True)),
1204 ([''], NS(x='', y=None)),
1205 (['a badger'], NS(x='a badger', y=None)),
1206 (['-a badger'], NS(x='-a badger', y=None)),
1207 (['-y', ''], NS(x=None, y='')),
1208 (['-y', 'a badger'], NS(x=None, y='a badger')),
1209 (['-y', '-a badger'], NS(x=None, y='-a badger')),
1210 (['--yyy=a badger'], NS(x=None, y='a badger')),
1211 (['--yyy=-a badger'], NS(x=None, y='-a badger')),
1225 ('', NS(x=None, y=42, z=False)),
1226 ('-', NS(x='badger', y=42, z=False)),
1227 ('- X', NS(x='X', y=42, z=False)),
1228 ('+ -3', NS(x=None, y=-3, z=False)),
1229 ('-+-', NS(x=None, y=42, z=True)),
1230 ('- ===', NS(x='===', y=42, z=False)),
1240 ('', NS(x=None, y=[])),
1241 ('-x', NS(x=[], y=[])),
1242 ('-x a', NS(x=['a'], y=[])),
1243 ('-x a -- b', NS(x=['a'], y=['b'])),
1244 ('a', NS(x=None, y=['a'])),
1245 ('a -x', NS(x=[], y=['a'])),
1246 ('a -x b', NS(x=['b'], y=['a'])),
1256 ('X', NS(x='X', y=[], z=None)),
1257 ('-z Z X', NS(x='X', y=[], z='Z')),
1258 ('X A B -z Z', NS(x='X', y=['A', 'B', '-z', 'Z'], z=None)),
1259 ('X Y --foo', NS(x='X', y=['Y', '--foo'], z=None)),
1276 ('', NS(x=None, y=None, z=[])),
1277 ('-x 2.5', NS(x=2.5, y=None, z=[])),
1278 ('-x 2.5 a', NS(x=2.5, y=None, z=['a'])),
1279 ('-3.5', NS(x=None, y=0.5, z=[])),
1280 ('-3-.5', NS(x=None, y=-0.5, z=[])),
1281 ('-3 .5', NS(x=None, y=0.5, z=[])),
1282 ('a -3.5', NS(x=None, y=0.5, z=['a'])),
1283 ('a', NS(x=None, y=None, z=['a'])),
1284 ('a -x 1', NS(x=1.0, y=None, z=['a'])),
1285 ('-x 1 a', NS(x=1.0, y=None, z=['a'])),
1286 ('-3 1 a', NS(x=None, y=1.0, z=['a'])),
1300 ('', NS()),
1301 ('a', NS(foo='a')),
1302 ('a b', NS(foo='a', bar=['b'])),
1303 ('--baz', NS(baz=True)),
1304 ('a --baz', NS(foo='a', baz=True)),
1305 ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
1320 ('', NS()),
1321 ('a', NS(foo='a')),
1322 ('a b', NS(foo='a', bar=['b'])),
1323 ('--baz', NS(baz=True)),
1324 ('a --baz', NS(foo='a', baz=True)),
1325 ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
1340 ('', NS(foo=42, bar=42, baz=42)),
1341 ('a', NS(foo='a', bar=42, baz=42)),
1342 ('a b', NS(foo='a', bar=['b'], baz=42)),
1343 ('--baz', NS(foo=42, bar=42, baz=True)),
1344 ('a --baz', NS(foo='a', bar=42, baz=True)),
1345 ('--baz a b', NS(foo='a', bar=['b'], baz=True)),
1374 ('X Y', NS(a=None, x='X', y=['Y'])),
1375 ('X -a A Y Z', NS(a='A', x='X', y=['Y', 'Z'])),
1376 ('@hello X', NS(a=None, x='hello world!', y=['X'])),
1377 ('X @hello', NS(a=None, x='X', y=['hello world!'])),
1378 ('-a B @recursive Y Z', NS(a='A', x='hello world!', y=['Y', 'Z'])),
1379 ('X @recursive Z -a B', NS(a='B', x='X', y=['hello world!', 'Z'])),
1380 (["-a", "", "X", "Y"], NS(a='', x='X', y=['Y'])),
1411 ('@hello X', NS(y=['hello', 'world!', 'X'])),
1466 ('foo', NS(x=None, spam=RFile('foo'))),
1467 ('-x foo bar', NS(x=RFile('foo'), spam=RFile('bar'))),
1468 ('bar -x foo', NS(x=RFile('foo'), spam=RFile('bar'))),
1469 ('-x - -', NS(x=sys.stdin, spam=sys.stdin)),
1470 ('readonly', NS(x=None, spam=RFile('readonly'))),
1487 successes = [('-c good', NS(c=RFile('good')))]
1506 ('foo', NS(x=None, spam=RFile('foo'))),
1507 ('-x foo bar', NS(x=RFile('foo'), spam=RFile('bar'))),
1508 ('bar -x foo', NS(x=RFile('foo'), spam=RFile('bar'))),
1509 ('-x - -', NS(x=sys.stdin, spam=sys.stdin)),
1548 ('foo', NS(x=None, spam=WFile('foo'))),
1549 ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
1550 ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
1551 ('-x - -', NS(x=sys.stdout, spam=sys.stdout)),
1563 ('foo', NS(x=None, spam=WFile('foo'))),
1564 ('-x foo bar', NS(x=WFile('foo'), spam=WFile('bar'))),
1565 ('bar -x foo', NS(x=WFile('foo'), spam=WFile('bar'))),
1566 NS(x=sys.stdout, spam=sys.stdout)),
1579 ('--eggs=42 42', NS(eggs=42, spam=42.0)),
1580 ('--eggs 2j -- -1.5', NS(eggs=2j, spam=-1.5)),
1581 ('1024.675', NS(eggs=None, spam=1024.675)),
1604 ('a -x b', NS(x=MyType('b'), spam=MyType('a'))),
1605 ('-xf g', NS(x=MyType('f'), spam=MyType('g'))),
1628 ('a -x b', NS(x=C('b'), spam=C('a'))),
1629 ('-xf g', NS(x=C('f'), spam=C('g'))),
1647 NS(x=None, y='my_type{1}'))
1649 NS(x='my_type{1}', y='my_type{42}'))
1668 expected_ns = NS(spam=0.25)
1692 expected_ns = NS(badger=2)
1716 ('-s0.125', NS(spam=0.125, badger=2)),
1717 ('42', NS(spam=0.25, badger=42)),
1718 ('-s 0.625 1', NS(spam=0.625, badger=1)),
1719 ('84 -s2', NS(spam=2.0, badger=84)),
1737 self.assertEqual(parser.parse_args(['1']), NS(badger='foo[1]'))
1738 self.assertEqual(parser.parse_args(['42']), NS(badger='foo[42]'))
1813 NS(foo=False, bar=0.5, w=7, x='b'),
1817 NS(foo=True, bar=0.25, y='2', z=[3j, -1j]),
1821 NS(foo=True, bar=0.125, w=None, x='c'),
1825 NS(foo=False, bar=-1.5, t=11, u=['a', '--foo', '7', '--', 'b']),
1831 (NS(foo=False, bar=0.5, w=7, x='b'), []),
1835 (NS(foo=False, bar=0.5, w=7, x='b'), ['-p']),
1839 (NS(foo=False, bar=0.5, w=7, x='b'), ['-p']),
1843 (NS(foo=False, bar=0.5, w=7, x='b'), ['-q', '-rs']),
1847 (NS(foo=False, bar=0.5, w=7, x='b'), ['-W', '-X', 'Y', 'Z']),
1856 self.assertEqual(NS(foo=False, bar='1', baz='2'),
2016 expected = NS(foo='1', bar='2', baz='3')
2026 expected = NS(foo='1', bar='2', baz='3')
2038 expected = NS(foo='1', bar='2', baz='3', frell='4')
2083 NS(w='3', y='1', z='2'))
2097 self.assertEqual(parse_args([]), NS(a=False, b=False))
2098 self.assertEqual(parse_args(['-a']), NS(a=True, b=False))
2099 self.assertEqual(parse_args(['-b']), NS(a=False, b=True))
2110 NS(a='3', b=None, d='1', w='2', y=None, z='4'))
2116 NS(a=True, b=False, w='2', y=None, z='3'))
2138 NS(w=None, y=None, z='2'))
2146 NS(a='3', b='1', d='2', e='4'))
2159 NS(a=True, b=False, c='4'))
2161 NS(a=False, b=True, w='2', y=None, z='3', e='4'))
2322 ('--bar X', NS(bar='X', baz=None)),
2323 ('--bar X --bar Z', NS(bar='Z', baz=None)),
2324 ('--baz Y', NS(bar=None, baz='Y')),
2325 ('--baz', NS(bar=None, baz='Z')),
2328 ('', NS(bar=None, baz=None)),
2359 ('--klmno X', NS(abcde=None, fghij=None, klmno='X', pqrst=None)),
2361 NS(abcde='Y', fghij=None, klmno='X', pqrst=None)),
2362 ('--pqrst X', NS(abcde=None, fghij=None, klmno=None, pqrst='X')),
2364 NS(abcde=None, fghij='Y', klmno=None, pqrst='X')),
2367 ('', NS(abcde=None, fghij=None, klmno=None, pqrst=None)),
2400 ('-x X', NS(x='X', y=True)),
2401 ('-x X -x Y', NS(x='Y', y=True)),
2402 ('-y', NS(x=None, y=False)),
2405 ('', NS(x=None, y=True)),
2439 ('--spam', NS(spam=True, badger=True, bladder=None)),
2440 ('--badger', NS(spam=False, badger=False, bladder=None)),
2441 ('--bladder B', NS(spam=False, badger=True, bladder='B')),
2442 ('--spam --spam', NS(spam=True, badger=True, bladder=None)),
2445 ('', NS(spam=False, badger=True, bladder=None)),
2476 ('--foo', NS(foo=True, spam=None, badger='X')),
2477 ('--spam S', NS(foo=False, spam='S', badger='X')),
2478 ('X', NS(foo=False, spam=None, badger=['X'])),
2479 ('X Y Z', NS(foo=False, spam=None, badger=['X', 'Y', 'Z'])),
2482 ('', NS(foo=False, spam=None, badger='X')),
2517 ('-a', NS(a=True, b=False, c=False, x=False, y=False)),
2518 ('-b', NS(a=False, b=True, c=False, x=False, y=False)),
2519 ('-c', NS(a=False, b=False, c=True, x=False, y=False)),
2520 ('-a -x', NS(a=True, b=False, c=False, x=True, y=False)),
2521 ('-y -b', NS(a=False, b=True, c=False, x=False, y=True)),
2522 ('-x -y -c', NS(a=False, b=False, c=True, x=True, y=True)),
2525 ('', NS(a=False, b=False, c=False, x=False, y=False)),
2526 ('-x', NS(a=False, b=False, c=False, x=True, y=False)),
2527 ('-y', NS(a=False, b=False, c=False, x=False, y=True)),
2559 ('--bar X', NS(bar='X', baz=None)),
2560 ('--baz Y', NS(bar=None, baz='Y')),
2563 ('', NS(bar=None, baz=None)),
2599 ('X A', NS(a='A', b=False, c=False, x='X', y=False)),
2600 ('X -b', NS(a=None, b=True, c=False, x='X', y=False)),
2601 ('X -c', NS(a=None, b=False, c=True, x='X', y=False)),
2602 ('X A -y', NS(a='A', b=False, c=False, x='X', y=True)),
2603 ('X -y -b', NS(a=None, b=True, c=False, x='X', y=True)),
2606 ('X', NS(a=None, b=False, c=False, x='X', y=False)),
2607 ('X -y', NS(a=None, b=False, c=False, x='X', y=True)),
2688 self.assertEqual(NS(x='foo', y='bar', z=1),
2690 self.assertEqual(NS(x='foo', y='bar', z=1),
2691 parser.parse_args([], NS()))
2692 self.assertEqual(NS(x='baz', y='bar', z=1),
2693 parser.parse_args([], NS(x='baz')))
2694 self.assertEqual(NS(x='baz', y='bar', z=2),
2695 parser.parse_args([], NS(x='baz', z=2)))
2701 self.assertEqual(NS(x='xfoox', y='bar'),
2703 self.assertEqual(NS(x='xfoox', y='bar'),
2704 parser.parse_args([], NS()))
2705 self.assertEqual(NS(x='baz', y='bar'),
2706 parser.parse_args([], NS(x='baz')))
2707 self.assertEqual(NS(x='1', y='bar'),
2709 self.assertEqual(NS(x='1', y='bar'),
2710 parser.parse_args('-x 1'.split(), NS()))
2711 self.assertEqual(NS(x='1', y='bar'),
2712 parser.parse_args('-x 1'.split(), NS(x='baz')))
2720 self.assertEqual(NS(x='foo', y='bar'),
2727 self.assertEqual(NS(x='foo'), parser.parse_args([]))
2734 self.assertEqual(NS(foo=2), parser.parse_args(['X']))
2745 self.assertEqual(NS(w='W', x='XX', y='Y', z='ZZ'),
2750 self.assertEqual(NS(w='WW', x='X', y='YY', z='Z'),
2764 self.assertEqual(NS(w='W', x='XX', y='Y', z='ZZ'),
2769 self.assertEqual(NS(w='WW', x='X', y='YY', z='Z'),
2802 ns = argparse.Namespace()
2803 self.assertEqual('' in ns, False)
2804 self.assertEqual('' not in ns, True)
2805 self.assertEqual('x' in ns, False)
2808 ns = argparse.Namespace(x=1, y=2)
2809 self.assertEqual('x' in ns, True)
2810 self.assertEqual('x' not in ns, False)
2811 self.assertEqual('y' in ns, True)
2812 self.assertEqual('' in ns, False)
2813 self.assertEqual('xx' in ns, False)
2814 self.assertEqual('z' in ns, False)
4421 ns = argparse.Namespace(foo=42, bar='spam')
4423 self.assertStringEqual(ns, string)
4440 ns = argparse.Namespace()
4441 self.assertRaises(AttributeError, getattr, ns, 'x')
4443 ns = argparse.Namespace(a=42, b='spam')
4444 self.assertEqual(ns.a, 42)
4445 self.assertEqual(ns.b, 'spam')
4465 ns = argparse.Namespace(a=1, b=2)
4466 self.assertIs(ns.__eq__(None), NotImplemented)
4467 self.assertIs(ns.__ne__(None), NotImplemented)
4535 self.assertEqual(NS(foo='foo_converted'), args)
4552 self.assertEqual(NS(foo=0), args)
4562 self.assertEqual(NS(foo='foo_converted'), args)
4574 self.assertEqual(NS(test='**'), args)
4614 self.assertEqual(NS(foo='F'), args)
4625 self.assertEqual(NS(v=3, spam=True, badger="B"), args)