| 729 | @skip_if_ABSTFN_contains_backslash |
| 730 | @_parameterize({}, {'strict': True}, {'strict': ALL_BUT_LAST}, {'strict': ALLOW_MISSING}) |
| 731 | def test_realpath_deep_recursion(self, kwargs): |
| 732 | depth = 10 |
| 733 | try: |
| 734 | os.mkdir(ABSTFN) |
| 735 | for i in range(depth): |
| 736 | os.symlink('/'.join(['%d' % i] * 10), ABSTFN + '/%d' % (i + 1)) |
| 737 | os.symlink('.', ABSTFN + '/0') |
| 738 | self.assertEqual(realpath(ABSTFN + '/%d' % depth, **kwargs), ABSTFN) |
| 739 | |
| 740 | # Test using relative path as well. |
| 741 | with os_helper.change_cwd(ABSTFN): |
| 742 | self.assertEqual(realpath('%d' % depth), ABSTFN) |
| 743 | finally: |
| 744 | for i in range(depth + 1): |
| 745 | os_helper.unlink(ABSTFN + '/%d' % i) |
| 746 | os_helper.rmdir(ABSTFN) |
| 747 | |
| 748 | @os_helper.skip_unless_symlink |
| 749 | @skip_if_ABSTFN_contains_backslash |