Lines Matching refs:with_suffix
561 self.assertEqual(P('a/b').with_suffix('.gz'), P('a/b.gz'))
562 self.assertEqual(P('/a/b').with_suffix('.gz'), P('/a/b.gz'))
563 self.assertEqual(P('a/b.py').with_suffix('.gz'), P('a/b.gz'))
564 self.assertEqual(P('/a/b.py').with_suffix('.gz'), P('/a/b.gz'))
566 self.assertEqual(P('a/b.py').with_suffix(''), P('a/b'))
567 self.assertEqual(P('/a/b').with_suffix(''), P('/a/b'))
569 self.assertRaises(ValueError, P('').with_suffix, '.gz')
570 self.assertRaises(ValueError, P('.').with_suffix, '.gz')
571 self.assertRaises(ValueError, P('/').with_suffix, '.gz')
573 self.assertRaises(ValueError, P('a/b').with_suffix, 'gz')
574 self.assertRaises(ValueError, P('a/b').with_suffix, '/')
575 self.assertRaises(ValueError, P('a/b').with_suffix, '.')
576 self.assertRaises(ValueError, P('a/b').with_suffix, '/.gz')
577 self.assertRaises(ValueError, P('a/b').with_suffix, 'c/d')
578 self.assertRaises(ValueError, P('a/b').with_suffix, '.c/.d')
579 self.assertRaises(ValueError, P('a/b').with_suffix, './.d')
580 self.assertRaises(ValueError, P('a/b').with_suffix, '.d/.')
581 self.assertRaises(ValueError, P('a/b').with_suffix,
982 self.assertEqual(P('c:a/b').with_suffix('.gz'), P('c:a/b.gz'))
983 self.assertEqual(P('c:/a/b').with_suffix('.gz'), P('c:/a/b.gz'))
984 self.assertEqual(P('c:a/b.py').with_suffix('.gz'), P('c:a/b.gz'))
985 self.assertEqual(P('c:/a/b.py').with_suffix('.gz'), P('c:/a/b.gz'))
987 self.assertRaises(ValueError, P('').with_suffix, '.gz')
988 self.assertRaises(ValueError, P('.').with_suffix, '.gz')
989 self.assertRaises(ValueError, P('/').with_suffix, '.gz')
990 self.assertRaises(ValueError, P('//My/Share').with_suffix, '.gz')
992 self.assertRaises(ValueError, P('c:a/b').with_suffix, 'gz')
993 self.assertRaises(ValueError, P('c:a/b').with_suffix, '/')
994 self.assertRaises(ValueError, P('c:a/b').with_suffix, '\\')
995 self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c:')
996 self.assertRaises(ValueError, P('c:a/b').with_suffix, '/.gz')
997 self.assertRaises(ValueError, P('c:a/b').with_suffix, '\\.gz')
998 self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c:.gz')
999 self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c/d')
1000 self.assertRaises(ValueError, P('c:a/b').with_suffix, 'c\\d')
1001 self.assertRaises(ValueError, P('c:a/b').with_suffix, '.c/d')
1002 self.assertRaises(ValueError, P('c:a/b').with_suffix, '.c\\d')