Lines Matching refs:assertEqual
31 self.assertEqual(actual, expected)
34 self.assertEqual(actual, expected)
82 self.assertEqual(f(''), ('', '', ''))
83 self.assertEqual(f('a'), ('', '', 'a'))
84 self.assertEqual(f('a/b'), ('', '', 'a/b'))
85 self.assertEqual(f('a/b/'), ('', '', 'a/b/'))
86 self.assertEqual(f('/a'), ('', '/', 'a'))
87 self.assertEqual(f('/a/b'), ('', '/', 'a/b'))
88 self.assertEqual(f('/a/b/'), ('', '/', 'a/b/'))
92 self.assertEqual(f('//a'), ('', '//', 'a'))
93 self.assertEqual(f('///a'), ('', '/', 'a'))
94 self.assertEqual(f('///a/b'), ('', '/', 'a/b'))
96 self.assertEqual(f('c:/a/b'), ('', '', 'c:/a/b'))
97 self.assertEqual(f('\\/a/b'), ('', '', '\\/a/b'))
98 self.assertEqual(f('\\a\\b'), ('', '', '\\a\\b'))
140 self.assertEqual(f(''), ('', '', ''))
141 self.assertEqual(f('a'), ('', '', 'a'))
142 self.assertEqual(f('a\\b'), ('', '', 'a\\b'))
143 self.assertEqual(f('\\a'), ('', '\\', 'a'))
144 self.assertEqual(f('\\a\\b'), ('', '\\', 'a\\b'))
145 self.assertEqual(f('c:a\\b'), ('c:', '', 'a\\b'))
146 self.assertEqual(f('c:\\a\\b'), ('c:', '\\', 'a\\b'))
148 self.assertEqual(f('\\\\a'), ('', '\\', 'a'))
149 self.assertEqual(f('\\\\\\a/b'), ('', '\\', 'a/b'))
150 self.assertEqual(f('c:\\\\a'), ('c:', '\\', 'a'))
151 self.assertEqual(f('c:\\\\\\a/b'), ('c:', '\\', 'a/b'))
153 self.assertEqual(f('\\\\a\\b'), ('\\\\a\\b', '\\', ''))
154 self.assertEqual(f('\\\\a\\b\\'), ('\\\\a\\b', '\\', ''))
155 self.assertEqual(f('\\\\a\\b\\c\\d'), ('\\\\a\\b', '\\', 'c\\d'))
159 self.assertEqual(f('\\\\\\a\\b'), ('', '\\', 'a\\b'))
160 self.assertEqual(f('\\\\a'), ('', '\\', 'a'))
201 self.assertEqual(P(P('a')), P('a'))
202 self.assertEqual(P(P('a'), 'b'), P('a/b'))
203 self.assertEqual(P(P('a'), P('b')), P('a/b'))
204 self.assertEqual(P(P('a'), P('b'), P('c')), P(FakePath("a/b/c")))
214 self.assertEqual(p, P(*args))
229 self.assertEqual(pp, P('a/b/c'))
232 self.assertEqual(pp, P('a/b/c/d'))
234 self.assertEqual(pp, P('a/b/c'))
236 self.assertEqual(pp, P('/c'))
243 self.assertEqual(pp, P('a/b/c'))
246 self.assertEqual(pp, P('a/b/c/d'))
248 self.assertEqual(pp, P('a/b/c/d'))
250 self.assertEqual(pp, P('c/a/b/d'))
252 self.assertEqual(pp, P('a/b/c'))
254 self.assertEqual(pp, P('/c'))
258 self.assertEqual(str(p), expected.replace('/', self.sep))
271 self.assertEqual(P(pathstr).as_posix(), pathstr)
277 self.assertEqual(bytes(P('a/b')), b'a' + sep + b'b')
295 self.assertEqual(eval(inner), p.as_posix())
299 self.assertEqual(q, p)
300 self.assertEqual(repr(q), r)
304 self.assertEqual(P('a/b'), P('a/b'))
305 self.assertEqual(P('a/b'), P('a', 'b'))
387 self.assertEqual(parts, ('a', 'b'))
393 self.assertEqual(parts, (sep, 'a', 'b'))
414 self.assertEqual(p, pcanon, "failed with args {}".format(t))
415 self.assertEqual(hash(p), hash(pcanon))
416 self.assertEqual(str(p), canon)
417 self.assertEqual(p.as_posix(), posix)
423 self.assertEqual(p.parent, P('a/b'))
424 self.assertEqual(p.parent.parent, P('a'))
425 self.assertEqual(p.parent.parent.parent, P())
426 self.assertEqual(p.parent.parent.parent.parent, P())
429 self.assertEqual(p.parent, P('/a/b'))
430 self.assertEqual(p.parent.parent, P('/a'))
431 self.assertEqual(p.parent.parent.parent, P('/'))
432 self.assertEqual(p.parent.parent.parent.parent, P('/'))
439 self.assertEqual(len(par), 3)
440 self.assertEqual(par[0], P('a/b'))
441 self.assertEqual(par[1], P('a'))
442 self.assertEqual(par[2], P('.'))
443 self.assertEqual(par[-1], P('.'))
444 self.assertEqual(par[-2], P('a'))
445 self.assertEqual(par[-3], P('a/b'))
446 self.assertEqual(par[0:1], (P('a/b'),))
447 self.assertEqual(par[:2], (P('a/b'), P('a')))
448 self.assertEqual(par[:-1], (P('a/b'), P('a')))
449 self.assertEqual(par[1:], (P('a'), P('.')))
450 self.assertEqual(par[::2], (P('a/b'), P('.')))
451 self.assertEqual(par[::-1], (P('.'), P('a'), P('a/b')))
452 self.assertEqual(list(par), [P('a/b'), P('a'), P('.')])
462 self.assertEqual(len(par), 3)
463 self.assertEqual(par[0], P('/a/b'))
464 self.assertEqual(par[1], P('/a'))
465 self.assertEqual(par[2], P('/'))
466 self.assertEqual(par[0:1], (P('/a/b'),))
467 self.assertEqual(par[:2], (P('/a/b'), P('/a')))
468 self.assertEqual(par[:-1], (P('/a/b'), P('/a')))
469 self.assertEqual(par[1:], (P('/a'), P('/')))
470 self.assertEqual(par[::2], (P('/a/b'), P('/')))
471 self.assertEqual(par[::-1], (P('/'), P('/a'), P('/a/b')))
472 self.assertEqual(list(par), [P('/a/b'), P('/a'), P('/')])
478 self.assertEqual(P('a/b').drive, '')
479 self.assertEqual(P('/a/b').drive, '')
480 self.assertEqual(P('').drive, '')
485 self.assertEqual(P('').root, '')
486 self.assertEqual(P('a/b').root, '')
487 self.assertEqual(P('/').root, sep)
488 self.assertEqual(P('/a/b').root, sep)
493 self.assertEqual(P('').anchor, '')
494 self.assertEqual(P('a/b').anchor, '')
495 self.assertEqual(P('/').anchor, sep)
496 self.assertEqual(P('/a/b').anchor, sep)
500 self.assertEqual(P('').name, '')
501 self.assertEqual(P('.').name, '')
502 self.assertEqual(P('/').name, '')
503 self.assertEqual(P('a/b').name, 'b')
504 self.assertEqual(P('/a/b').name, 'b')
505 self.assertEqual(P('/a/b/.').name, 'b')
506 self.assertEqual(P('a/b.py').name, 'b.py')
507 self.assertEqual(P('/a/b.py').name, 'b.py')
511 self.assertEqual(P('').suffix, '')
512 self.assertEqual(P('.').suffix, '')
513 self.assertEqual(P('..').suffix, '')
514 self.assertEqual(P('/').suffix, '')
515 self.assertEqual(P('a/b').suffix, '')
516 self.assertEqual(P('/a/b').suffix, '')
517 self.assertEqual(P('/a/b/.').suffix, '')
518 self.assertEqual(P('a/b.py').suffix, '.py')
519 self.assertEqual(P('/a/b.py').suffix, '.py')
520 self.assertEqual(P('a/.hgrc').suffix, '')
521 self.assertEqual(P('/a/.hgrc').suffix, '')
522 self.assertEqual(P('a/.hg.rc').suffix, '.rc')
523 self.assertEqual(P('/a/.hg.rc').suffix, '.rc')
524 self.assertEqual(P('a/b.tar.gz').suffix, '.gz')
525 self.assertEqual(P('/a/b.tar.gz').suffix, '.gz')
526 self.assertEqual(P('a/Some name. Ending with a dot.').suffix, '')
527 self.assertEqual(P('/a/Some name. Ending with a dot.').suffix, '')
531 self.assertEqual(P('').suffixes, [])
532 self.assertEqual(P('.').suffixes, [])
533 self.assertEqual(P('/').suffixes, [])
534 self.assertEqual(P('a/b').suffixes, [])
535 self.assertEqual(P('/a/b').suffixes, [])
536 self.assertEqual(P('/a/b/.').suffixes, [])
537 self.assertEqual(P('a/b.py').suffixes, ['.py'])
538 self.assertEqual(P('/a/b.py').suffixes, ['.py'])
539 self.assertEqual(P('a/.hgrc').suffixes, [])
540 self.assertEqual(P('/a/.hgrc').suffixes, [])
541 self.assertEqual(P('a/.hg.rc').suffixes, ['.rc'])
542 self.assertEqual(P('/a/.hg.rc').suffixes, ['.rc'])
543 self.assertEqual(P('a/b.tar.gz').suffixes, ['.tar', '.gz'])
544 self.assertEqual(P('/a/b.tar.gz').suffixes, ['.tar', '.gz'])
545 self.assertEqual(P('a/Some name. Ending with a dot.').suffixes, [])
546 self.assertEqual(P('/a/Some name. Ending with a dot.').suffixes, [])
550 self.assertEqual(P('').stem, '')
551 self.assertEqual(P('.').stem, '')
552 self.assertEqual(P('..').stem, '..')
553 self.assertEqual(P('/').stem, '')
554 self.assertEqual(P('a/b').stem, 'b')
555 self.assertEqual(P('a/b.py').stem, 'b')
556 self.assertEqual(P('a/.hgrc').stem, '.hgrc')
557 self.assertEqual(P('a/.hg.rc').stem, '.hg')
558 self.assertEqual(P('a/b.tar.gz').stem, 'b.tar')
559 self.assertEqual(P('a/Some name. Ending with a dot.').stem,
564 self.assertEqual(P('a/b').with_name('d.xml'), P('a/d.xml'))
565 self.assertEqual(P('/a/b').with_name('d.xml'), P('/a/d.xml'))
566 self.assertEqual(P('a/b.py').with_name('d.xml'), P('a/d.xml'))
567 self.assertEqual(P('/a/b.py').with_name('d.xml'), P('/a/d.xml'))
568 self.assertEqual(P('a/Dot ending.').with_name('d.xml'), P('a/d.xml'))
569 self.assertEqual(P('/a/Dot ending.').with_name('d.xml'), P('/a/d.xml'))
580 self.assertEqual(P('a/b').with_stem('d'), P('a/d'))
581 self.assertEqual(P('/a/b').with_stem('d'), P('/a/d'))
582 self.assertEqual(P('a/b.py').with_stem('d'), P('a/d.py'))
583 self.assertEqual(P('/a/b.py').with_stem('d'), P('/a/d.py'))
584 self.assertEqual(P('/a/b.tar.gz').with_stem('d'), P('/a/d.gz'))
585 self.assertEqual(P('a/Dot ending.').with_stem('d'), P('a/d'))
586 self.assertEqual(P('/a/Dot ending.').with_stem('d'), P('/a/d'))
597 self.assertEqual(P('a/b').with_suffix('.gz'), P('a/b.gz'))
598 self.assertEqual(P('/a/b').with_suffix('.gz'), P('/a/b.gz'))
599 self.assertEqual(P('a/b.py').with_suffix('.gz'), P('a/b.gz'))
600 self.assertEqual(P('/a/b.py').with_suffix('.gz'), P('/a/b.gz'))
602 self.assertEqual(P('a/b.py').with_suffix(''), P('a/b'))
603 self.assertEqual(P('/a/b').with_suffix(''), P('/a/b'))
625 self.assertEqual(p.relative_to(P()), P('a/b'))
626 self.assertEqual(p.relative_to(''), P('a/b'))
627 self.assertEqual(p.relative_to(P('a')), P('b'))
628 self.assertEqual(p.relative_to('a'), P('b'))
629 self.assertEqual(p.relative_to('a/'), P('b'))
630 self.assertEqual(p.relative_to(P('a/b')), P())
631 self.assertEqual(p.relative_to('a/b'), P())
633 self.assertEqual(p.relative_to('a', 'b'), P())
640 self.assertEqual(p.relative_to(P('/')), P('a/b'))
641 self.assertEqual(p.relative_to('/'), P('a/b'))
642 self.assertEqual(p.relative_to(P('/a')), P('b'))
643 self.assertEqual(p.relative_to('/a'), P('b'))
644 self.assertEqual(p.relative_to('/a/'), P('b'))
645 self.assertEqual(p.relative_to(P('/a/b')), P())
646 self.assertEqual(p.relative_to('/a/b'), P())
696 self.assertEqual(pp, p)
697 self.assertEqual(hash(pp), hash(p))
698 self.assertEqual(str(pp), str(p))
706 self.assertEqual(P('/a/b').root, '/')
707 self.assertEqual(P('///a/b').root, '/')
709 self.assertEqual(P('//a/b').root, '//')
714 self.assertEqual(P('/a'), P('///a'))
719 self.assertEqual(P('/').as_uri(), 'file:///')
720 self.assertEqual(P('/a/b.c').as_uri(), 'file:///a/b.c')
721 self.assertEqual(P('/a/b%#c').as_uri(), 'file:///a/b%25%23c')
730 self.assertEqual(P('/a/b\xe9').as_uri(),
759 self.assertEqual(pp, P('//a/b'))
761 self.assertEqual(pp, P('//c'))
763 self.assertEqual(pp, P('/c'))
770 self.assertEqual(pp, P('//a/b'))
772 self.assertEqual(pp, P('//c'))
774 self.assertEqual(pp, P('/c'))
795 self.assertEqual(str(p), 'a\\b\\c')
797 self.assertEqual(str(p), 'c:\\a\\b\\c')
799 self.assertEqual(str(p), '\\\\a\\b\\')
801 self.assertEqual(str(p), '\\\\a\\b\\c')
803 self.assertEqual(str(p), '\\\\a\\b\\c\\d')
818 self.assertEqual(P('c:a/b'), P('c:a/b'))
819 self.assertEqual(P('c:a/b'), P('c:', 'a', 'b'))
824 self.assertEqual(P('a/B'), P('A/b'))
825 self.assertEqual(P('C:a/B'), P('c:A/b'))
826 self.assertEqual(P('//Some/SHARE/a/B'), P('//somE/share/A/b'))
834 self.assertEqual(P('c:/').as_uri(), 'file:///c:/')
835 self.assertEqual(P('c:/a/b.c').as_uri(), 'file:///c:/a/b.c')
836 self.assertEqual(P('c:/a/b%#c').as_uri(), 'file:///c:/a/b%25%23c')
837 self.assertEqual(P('c:/a/b\xe9').as_uri(), 'file:///c:/a/b%C3%A9')
838 self.assertEqual(P('//some/share/').as_uri(), 'file://some/share/')
839 self.assertEqual(P('//some/share/a/b.c').as_uri(),
841 self.assertEqual(P('//some/share/a/b%#c\xe9').as_uri(),
889 self.assertEqual(parts, ('c:', 'a', 'b'))
892 self.assertEqual(parts, ('c:\\', 'a', 'b'))
895 self.assertEqual(parts, ('\\\\a\\b\\', 'c', 'd'))
901 self.assertEqual(p.parent, P('z:a/b'))
902 self.assertEqual(p.parent.parent, P('z:a'))
903 self.assertEqual(p.parent.parent.parent, P('z:'))
904 self.assertEqual(p.parent.parent.parent.parent, P('z:'))
906 self.assertEqual(p.parent, P('z:/a/b'))
907 self.assertEqual(p.parent.parent, P('z:/a'))
908 self.assertEqual(p.parent.parent.parent, P('z:/'))
909 self.assertEqual(p.parent.parent.parent.parent, P('z:/'))
911 self.assertEqual(p.parent, P('//a/b/c'))
912 self.assertEqual(p.parent.parent, P('//a/b'))
913 self.assertEqual(p.parent.parent.parent, P('//a/b'))
920 self.assertEqual(len(par), 2)
921 self.assertEqual(par[0], P('z:a'))
922 self.assertEqual(par[1], P('z:'))
923 self.assertEqual(par[0:1], (P('z:a'),))
924 self.assertEqual(par[:-1], (P('z:a'),))
925 self.assertEqual(par[:2], (P('z:a'), P('z:')))
926 self.assertEqual(par[1:], (P('z:'),))
927 self.assertEqual(par[::2], (P('z:a'),))
928 self.assertEqual(par[::-1], (P('z:'), P('z:a')))
929 self.assertEqual(list(par), [P('z:a'), P('z:')])
934 self.assertEqual(len(par), 2)
935 self.assertEqual(par[0], P('z:/a'))
936 self.assertEqual(par[1], P('z:/'))
937 self.assertEqual(par[0:1], (P('z:/a'),))
938 self.assertEqual(par[0:-1], (P('z:/a'),))
939 self.assertEqual(par[:2], (P('z:/a'), P('z:/')))
940 self.assertEqual(par[1:], (P('z:/'),))
941 self.assertEqual(par[::2], (P('z:/a'),))
942 self.assertEqual(par[::-1], (P('z:/'), P('z:/a'),))
943 self.assertEqual(list(par), [P('z:/a'), P('z:/')])
948 self.assertEqual(len(par), 2)
949 self.assertEqual(par[0], P('//a/b/c'))
950 self.assertEqual(par[1], P('//a/b'))
951 self.assertEqual(par[0:1], (P('//a/b/c'),))
952 self.assertEqual(par[0:-1], (P('//a/b/c'),))
953 self.assertEqual(par[:2], (P('//a/b/c'), P('//a/b')))
954 self.assertEqual(par[1:], (P('//a/b'),))
955 self.assertEqual(par[::2], (P('//a/b/c'),))
956 self.assertEqual(par[::-1], (P('//a/b'), P('//a/b/c')))
957 self.assertEqual(list(par), [P('//a/b/c'), P('//a/b')])
963 self.assertEqual(P('c:').drive, 'c:')
964 self.assertEqual(P('c:a/b').drive, 'c:')
965 self.assertEqual(P('c:/').drive, 'c:')
966 self.assertEqual(P('c:/a/b/').drive, 'c:')
967 self.assertEqual(P('//a/b').drive, '\\\\a\\b')
968 self.assertEqual(P('//a/b/').drive, '\\\\a\\b')
969 self.assertEqual(P('//a/b/c/d').drive, '\\\\a\\b')
973 self.assertEqual(P('c:').root, '')
974 self.assertEqual(P('c:a/b').root, '')
975 self.assertEqual(P('c:/').root, '\\')
976 self.assertEqual(P('c:/a/b/').root, '\\')
977 self.assertEqual(P('//a/b').root, '\\')
978 self.assertEqual(P('//a/b/').root, '\\')
979 self.assertEqual(P('//a/b/c/d').root, '\\')
983 self.assertEqual(P('c:').anchor, 'c:')
984 self.assertEqual(P('c:a/b').anchor, 'c:')
985 self.assertEqual(P('c:/').anchor, 'c:\\')
986 self.assertEqual(P('c:/a/b/').anchor, 'c:\\')
987 self.assertEqual(P('//a/b').anchor, '\\\\a\\b\\')
988 self.assertEqual(P('//a/b/').anchor, '\\\\a\\b\\')
989 self.assertEqual(P('//a/b/c/d').anchor, '\\\\a\\b\\')
993 self.assertEqual(P('c:').name, '')
994 self.assertEqual(P('c:/').name, '')
995 self.assertEqual(P('c:a/b').name, 'b')
996 self.assertEqual(P('c:/a/b').name, 'b')
997 self.assertEqual(P('c:a/b.py').name, 'b.py')
998 self.assertEqual(P('c:/a/b.py').name, 'b.py')
999 self.assertEqual(P('//My.py/Share.php').name, '')
1000 self.assertEqual(P('//My.py/Share.php/a/b').name, 'b')
1004 self.assertEqual(P('c:').suffix, '')
1005 self.assertEqual(P('c:/').suffix, '')
1006 self.assertEqual(P('c:a/b').suffix, '')
1007 self.assertEqual(P('c:/a/b').suffix, '')
1008 self.assertEqual(P('c:a/b.py').suffix, '.py')
1009 self.assertEqual(P('c:/a/b.py').suffix, '.py')
1010 self.assertEqual(P('c:a/.hgrc').suffix, '')
1011 self.assertEqual(P('c:/a/.hgrc').suffix, '')
1012 self.assertEqual(P('c:a/.hg.rc').suffix, '.rc')
1013 self.assertEqual(P('c:/a/.hg.rc').suffix, '.rc')
1014 self.assertEqual(P('c:a/b.tar.gz').suffix, '.gz')
1015 self.assertEqual(P('c:/a/b.tar.gz').suffix, '.gz')
1016 self.assertEqual(P('c:a/Some name. Ending with a dot.').suffix, '')
1017 self.assertEqual(P('c:/a/Some name. Ending with a dot.').suffix, '')
1018 self.assertEqual(P('//My.py/Share.php').suffix, '')
1019 self.assertEqual(P('//My.py/Share.php/a/b').suffix, '')
1023 self.assertEqual(P('c:').suffixes, [])
1024 self.assertEqual(P('c:/').suffixes, [])
1025 self.assertEqual(P('c:a/b').suffixes, [])
1026 self.assertEqual(P('c:/a/b').suffixes, [])
1027 self.assertEqual(P('c:a/b.py').suffixes, ['.py'])
1028 self.assertEqual(P('c:/a/b.py').suffixes, ['.py'])
1029 self.assertEqual(P('c:a/.hgrc').suffixes, [])
1030 self.assertEqual(P('c:/a/.hgrc').suffixes, [])
1031 self.assertEqual(P('c:a/.hg.rc').suffixes, ['.rc'])
1032 self.assertEqual(P('c:/a/.hg.rc').suffixes, ['.rc'])
1033 self.assertEqual(P('c:a/b.tar.gz').suffixes, ['.tar', '.gz'])
1034 self.assertEqual(P('c:/a/b.tar.gz').suffixes, ['.tar', '.gz'])
1035 self.assertEqual(P('//My.py/Share.php').suffixes, [])
1036 self.assertEqual(P('//My.py/Share.php/a/b').suffixes, [])
1037 self.assertEqual(P('c:a/Some name. Ending with a dot.').suffixes, [])
1038 self.assertEqual(P('c:/a/Some name. Ending with a dot.').suffixes, [])
1042 self.assertEqual(P('c:').stem, '')
1043 self.assertEqual(P('c:.').stem, '')
1044 self.assertEqual(P('c:..').stem, '..')
1045 self.assertEqual(P('c:/').stem, '')
1046 self.assertEqual(P('c:a/b').stem, 'b')
1047 self.assertEqual(P('c:a/b.py').stem, 'b')
1048 self.assertEqual(P('c:a/.hgrc').stem, '.hgrc')
1049 self.assertEqual(P('c:a/.hg.rc').stem, '.hg')
1050 self.assertEqual(P('c:a/b.tar.gz').stem, 'b.tar')
1051 self.assertEqual(P('c:a/Some name. Ending with a dot.').stem,
1056 self.assertEqual(P('c:a/b').with_name('d.xml'), P('c:a/d.xml'))
1057 self.assertEqual(P('c:/a/b').with_name('d.xml'), P('c:/a/d.xml'))
1058 self.assertEqual(P('c:a/Dot ending.').with_name('d.xml'), P('c:a/d.xml'))
1059 self.assertEqual(P('c:/a/Dot ending.').with_name('d.xml'), P('c:/a/d.xml'))
1070 self.assertEqual(P('c:a/b').with_stem('d'), P('c:a/d'))
1071 self.assertEqual(P('c:/a/b').with_stem('d'), P('c:/a/d'))
1072 self.assertEqual(P('c:a/Dot ending.').with_stem('d'), P('c:a/d'))
1073 self.assertEqual(P('c:/a/Dot ending.').with_stem('d'), P('c:/a/d'))
1084 self.assertEqual(P('c:a/b').with_suffix('.gz'), P('c:a/b.gz'))
1085 self.assertEqual(P('c:/a/b').with_suffix('.gz'), P('c:/a/b.gz'))
1086 self.assertEqual(P('c:a/b.py').with_suffix('.gz'), P('c:a/b.gz'))
1087 self.assertEqual(P('c:/a/b.py').with_suffix('.gz'), P('c:/a/b.gz'))
1109 self.assertEqual(p.relative_to(P('c:')), P('Foo/Bar'))
1110 self.assertEqual(p.relative_to('c:'), P('Foo/Bar'))
1111 self.assertEqual(p.relative_to(P('c:foO')), P('Bar'))
1112 self.assertEqual(p.relative_to('c:foO'), P('Bar'))
1113 self.assertEqual(p.relative_to('c:foO/'), P('Bar'))
1114 self.assertEqual(p.relative_to(P('c:foO/baR')), P())
1115 self.assertEqual(p.relative_to('c:foO/baR'), P())
1127 self.assertEqual(p.relative_to(P('c:')), P('/Foo/Bar'))
1128 self.assertEqual(p.relative_to('c:'), P('/Foo/Bar'))
1129 self.assertEqual(str(p.relative_to(P('c:'))), '\\Foo\\Bar')
1130 self.assertEqual(str(p.relative_to('c:')), '\\Foo\\Bar')
1131 self.assertEqual(p.relative_to(P('c:/')), P('Foo/Bar'))
1132 self.assertEqual(p.relative_to('c:/'), P('Foo/Bar'))
1133 self.assertEqual(p.relative_to(P('c:/foO')), P('Bar'))
1134 self.assertEqual(p.relative_to('c:/foO'), P('Bar'))
1135 self.assertEqual(p.relative_to('c:/foO/'), P('Bar'))
1136 self.assertEqual(p.relative_to(P('c:/foO/baR')), P())
1137 self.assertEqual(p.relative_to('c:/foO/baR'), P())
1150 self.assertEqual(p.relative_to(P('//sErver/sHare')), P('Foo/Bar'))
1151 self.assertEqual(p.relative_to('//sErver/sHare'), P('Foo/Bar'))
1152 self.assertEqual(p.relative_to('//sErver/sHare/'), P('Foo/Bar'))
1153 self.assertEqual(p.relative_to(P('//sErver/sHare/Foo')), P('Bar'))
1154 self.assertEqual(p.relative_to('//sErver/sHare/Foo'), P('Bar'))
1155 self.assertEqual(p.relative_to('//sErver/sHare/Foo/'), P('Bar'))
1156 self.assertEqual(p.relative_to(P('//sErver/sHare/Foo/Bar')), P())
1157 self.assertEqual(p.relative_to('//sErver/sHare/Foo/Bar'), P())
1242 self.assertEqual(pp, P('C:/a/b/x/y'))
1244 self.assertEqual(pp, P('C:/x/y'))
1248 self.assertEqual(pp, P('D:x/y'))
1250 self.assertEqual(pp, P('D:/x/y'))
1252 self.assertEqual(pp, P('//host/share/x/y'))
1256 self.assertEqual(pp, P('C:/a/b/x/y'))
1258 self.assertEqual(pp, P('C:/x/y'))
1264 self.assertEqual(p / 'x/y', P('C:/a/b/x/y'))
1265 self.assertEqual(p / 'x' / 'y', P('C:/a/b/x/y'))
1266 self.assertEqual(p / '/x/y', P('C:/x/y'))
1267 self.assertEqual(p / '/x' / 'y', P('C:/x/y'))
1270 self.assertEqual(p / 'D:x/y', P('D:x/y'))
1271 self.assertEqual(p / 'D:' / 'x/y', P('D:x/y'))
1272 self.assertEqual(p / 'D:/x/y', P('D:/x/y'))
1273 self.assertEqual(p / 'D:' / '/x/y', P('D:/x/y'))
1274 self.assertEqual(p / '//host/share/x/y', P('//host/share/x/y'))
1277 self.assertEqual(p / 'c:x/y', P('C:/a/b/x/y'))
1278 self.assertEqual(p / 'c:/x/y', P('C:/x/y'))
1443 self.assertEqual(cm.exception.errno, errno.ENOENT)
1446 self.assertEqual(os.path.normcase(path_a), os.path.normcase(path_b))
1450 self.assertEqual(p, q)
1461 self.assertEqual(p, q)
1501 self.assertEqual(p.stat(), os.stat('.'))
1506 self.assertEqual(p.expanduser(), P(os.path.expanduser('~')))
1508 self.assertEqual(p.expanduser(), p)
1510 self.assertEqual(p.expanduser(), p)
1512 self.assertEqual(p.expanduser(), p)
1514 self.assertEqual(p.expanduser(), p)
1537 self.assertEqual(f.read(), "this is file A\n")
1540 self.assertEqual(f.read().strip(), b"this is file A")
1543 self.assertEqual(f.read().strip(), b"this is file A")
1548 self.assertEqual((p / 'fileA').read_bytes(), b'abcdefg')
1551 self.assertEqual((p / 'fileA').read_bytes(), b'abcdefg')
1556 self.assertEqual((p / 'fileA').read_text(
1560 self.assertEqual((p / 'fileA').read_text(encoding='latin-1'), 'äbcdefg')
1566 self.assertEqual((p / 'fileA').read_bytes(),
1570 self.assertEqual((p / 'fileA').read_bytes(),
1574 self.assertEqual((p / 'fileA').read_bytes(),
1579 self.assertEqual((p / 'fileA').read_bytes(),
1590 self.assertEqual(paths, { P(BASE, q) for q in expected })
1599 self.assertEqual(paths, expected)
1613 self.assertEqual(set(glob), { P(BASE, q) for q in expected })
1637 self.assertEqual(set(glob), { P(BASE, q) for q in expected })
1672 self.assertEqual(given, {p / x for x in expect})
1683 self.assertEqual(next(it), p)
1689 self.assertEqual(next(it), p)
1695 self.assertEqual(set(p.glob("..")), { P(BASE, "..") })
1696 self.assertEqual(set(p.glob("dirA/../file*")), { P(BASE, "dirA/../fileA") })
1697 self.assertEqual(set(p.glob("../xyzzy")), set())
1722 self.assertEqual(len(set(base.glob("*"))), 3)
1728 self.assertEqual(len(set(base.glob("*"))), 4)
1734 self.assertEqual(len(set(base.glob("*"))), 4)
1738 self.assertEqual(q, expected)
1749 self.assertEqual(cm.exception.errno, errno.ENOENT)
1812 self.assertEqual(q.resolve(strict=True), p)
1816 self.assertEqual(r.resolve(strict=False), p / '3' / '4')
1824 self.assertEqual(p.resolve(), self.cls(BASE, p))
1851 self.assertEqual(p.stat().st_mode, new_mode)
1855 self.assertEqual(p.stat().st_mode, new_mode)
1866 self.assertEqual(q.stat().st_mode, new_mode)
1870 self.assertEqual(q.stat().st_mode, new_mode)
1877 self.assertEqual(p.stat(), st)
1892 self.assertEqual(st, p.stat(follow_symlinks=False))
1903 self.assertEqual(st, p.lstat())
1914 self.assertEqual(name, p.owner())
1925 self.assertEqual(name, p.group())
1958 self.assertEqual(q.stat().st_size, size)
1959 self.assertEqual(os.path.samefile(p, q), True)
1965 self.assertEqual(os.stat(r).st_size, size)
1976 self.assertEqual(link.stat().st_size, size)
1983 self.assertEqual(os.stat(target2).st_size, size)
2002 self.assertEqual(renamed_p, q)
2003 self.assertEqual(q.stat().st_size, size)
2008 self.assertEqual(renamed_q, self.cls(r))
2009 self.assertEqual(os.stat(r).st_size, size)
2019 self.assertEqual(replaced_p, q)
2020 self.assertEqual(q.stat().st_size, size)
2025 self.assertEqual(replaced_q, self.cls(r))
2026 self.assertEqual(os.stat(r).st_size, size)
2032 self.assertEqual((P / 'linkA').readlink(), self.cls('fileA'))
2033 self.assertEqual((P / 'brokenLink').readlink(),
2035 self.assertEqual((P / 'linkB').readlink(), self.cls('dirB'))
2068 self.assertEqual(f.read().strip(), b"this is file A")
2079 self.assertEqual(cm.exception.errno, errno.EEXIST)
2087 self.assertEqual(cm.exception.errno, errno.ENOENT)
2093 self.assertEqual(cm.exception.errno, errno.EEXIST)
2102 self.assertEqual(stat.S_IMODE(p.stat().st_mode), 0o7555 & mode)
2104 self.assertEqual(stat.S_IMODE(p.parent.stat().st_mode), mode)
2113 self.assertEqual(cm.exception.errno, errno.EEXIST)
2116 self.assertEqual(p.stat().st_ctime, st_ctime_first)
2123 self.assertEqual(cm.exception.errno, errno.EEXIST)
2130 self.assertEqual(cm.exception.errno, errno.EEXIST)
2133 self.assertEqual(p.stat().st_ctime, st_ctime_first)
2158 self.assertEqual(cm.exception.errno, errno.EEXIST)
2161 self.assertEqual(cm.exception.errno, errno.EEXIST)
2170 self.assertEqual(cm.exception.errno, errno.EEXIST)
2173 self.assertEqual(cm.exception.errno, errno.EEXIST)
2211 self.assertEqual(link.stat(), target.stat())
2216 self.assertEqual(link.stat(), target.stat())
2223 self.assertEqual(link.stat(), target.stat())
2368 self.assertEqual(pp.stat(), p.stat())
2389 self.assertEqual(p, P)
2392 self.assertEqual(p, P)
2395 self.assertEqual(p, P)
2398 self.assertEqual(p, P)
2406 self.assertEqual(p, P)
2409 self.assertEqual(p, P)
2412 self.assertEqual(p, P)
2415 self.assertEqual(p, P)
2472 self.assertEqual(stat.S_IMODE(st.st_mode), 0o666)
2477 self.assertEqual(stat.S_IMODE(st.st_mode), 0o644)
2484 self.assertEqual(str(p.resolve()), '/spam')
2494 self.assertEqual(stat.S_IMODE(st.st_mode), 0o666)
2498 self.assertEqual(stat.S_IMODE(st.st_mode), 0o644)
2501 self.assertEqual(stat.S_IMODE(st.st_mode), 0o750)
2529 self.assertEqual(given, expect)
2530 self.assertEqual(set(p.glob("FILEa*")), set())
2537 self.assertEqual(given, expect)
2538 self.assertEqual(set(p.rglob("FILEd*")), set())
2580 self.assertEqual(p1.expanduser(), P(userhome) / 'Documents')
2581 self.assertEqual(p2.expanduser(), P(userhome) / 'Documents')
2582 self.assertEqual(p3.expanduser(), P(otherhome) / 'Documents')
2583 self.assertEqual(p4.expanduser(), p4)
2584 self.assertEqual(p5.expanduser(), p5)
2585 self.assertEqual(p6.expanduser(), p6)
2589 self.assertEqual(p1.expanduser(), P('/tmp/Documents'))
2590 self.assertEqual(p2.expanduser(), P(userhome) / 'Documents')
2591 self.assertEqual(p3.expanduser(), P(otherhome) / 'Documents')
2592 self.assertEqual(p4.expanduser(), p4)
2593 self.assertEqual(p5.expanduser(), p5)
2594 self.assertEqual(p6.expanduser(), p6)
2628 self.assertEqual(set(p.glob("FILEa")), { P(BASE, "fileA") })
2629 self.assertEqual(set(p.glob("F*a")), { P(BASE, "fileA") })
2630 self.assertEqual(set(map(str, p.glob("FILEa"))), {f"{p}\\FILEa"})
2631 self.assertEqual(set(map(str, p.glob("F*a"))), {f"{p}\\fileA"})
2636 self.assertEqual(set(p.rglob("FILEd")), { P(BASE, "dirC/dirD/fileD") })
2637 self.assertEqual(set(map(str, p.rglob("FILEd"))), {f"{p}\\dirD\\FILEd"})
2658 self.assertEqual(p4.expanduser(), p4)
2659 self.assertEqual(p5.expanduser(), p5)
2660 self.assertEqual(p6.expanduser(), p6)
2664 self.assertEqual(p1.expanduser(),
2668 self.assertEqual(p2.expanduser(),
2670 self.assertEqual(p3.expanduser(),
2672 self.assertEqual(p4.expanduser(), p4)
2673 self.assertEqual(p5.expanduser(), p5)
2674 self.assertEqual(p6.expanduser(), p6)
2718 self.assertEqual(result.string, "test/right")
2727 self.assertEqual(result.string, "left/test")