Test functions that call path_error2(), providing two filenames in their exceptions.
(self)
| 1538 | raise unittest.SkipTest("OSError raised!") |
| 1539 | |
| 1540 | def test_path_error2(self): |
| 1541 | """ |
| 1542 | Test functions that call path_error2(), providing two filenames in their exceptions. |
| 1543 | """ |
| 1544 | for name in ("rename", "replace", "link"): |
| 1545 | function = getattr(os, name, None) |
| 1546 | if function is None: |
| 1547 | continue |
| 1548 | |
| 1549 | for dst in ("noodly2", os_helper.TESTFN): |
| 1550 | try: |
| 1551 | function('doesnotexistfilename', dst) |
| 1552 | except OSError as e: |
| 1553 | self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e)) |
| 1554 | break |
| 1555 | else: |
| 1556 | self.fail("No valid path_error2() test for os." + name) |
| 1557 | |
| 1558 | def test_path_with_null_character(self): |
| 1559 | fn = os_helper.TESTFN |