Lines Matching refs:realpath
5 from posixpath import realpath, abspath, dirname, basename
329 self.assertEqual(realpath('.'), os.getcwd())
330 self.assertEqual(realpath('./.'), os.getcwd())
331 self.assertEqual(realpath('/'.join(['.'] * 100)), os.getcwd())
333 self.assertEqual(realpath(b'.'), os.getcwdb())
334 self.assertEqual(realpath(b'./.'), os.getcwdb())
335 self.assertEqual(realpath(b'/'.join([b'.'] * 100)), os.getcwdb())
339 self.assertEqual(realpath('..'), dirname(os.getcwd()))
340 self.assertEqual(realpath('../..'), dirname(dirname(os.getcwd())))
341 self.assertEqual(realpath('/'.join(['..'] * 100)), '/')
343 self.assertEqual(realpath(b'..'), dirname(os.getcwdb()))
344 self.assertEqual(realpath(b'../..'), dirname(dirname(os.getcwdb())))
345 self.assertEqual(realpath(b'/'.join([b'..'] * 100)), b'/')
354 self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
366 self.assertRaises(FileNotFoundError, realpath, ABSTFN, strict=True)
367 self.assertRaises(FileNotFoundError, realpath, ABSTFN + "2", strict=True)
377 self.assertEqual(realpath(ABSTFN), ABSTFN+"1")
389 self.assertEqual(realpath(ABSTFN), ABSTFN)
393 self.assertEqual(realpath(ABSTFN+"1"), ABSTFN+"1")
394 self.assertEqual(realpath(ABSTFN+"2"), ABSTFN+"2")
396 self.assertEqual(realpath(ABSTFN+"1/x"), ABSTFN+"1/x")
397 self.assertEqual(realpath(ABSTFN+"1/.."), dirname(ABSTFN))
398 self.assertEqual(realpath(ABSTFN+"1/../x"), dirname(ABSTFN) + "/x")
400 self.assertEqual(realpath(ABSTFN+"1/../" + basename(ABSTFN) + "y"),
402 self.assertEqual(realpath(ABSTFN+"1/../" + basename(ABSTFN) + "1"),
406 self.assertEqual(realpath(ABSTFN+"a"), ABSTFN+"a/b")
410 self.assertEqual(realpath(ABSTFN+"c"), ABSTFN+"c")
414 self.assertEqual(realpath(basename(ABSTFN)), ABSTFN)
431 self.assertRaises(OSError, realpath, ABSTFN, strict=True)
435 self.assertRaises(OSError, realpath, ABSTFN+"1", strict=True)
436 self.assertRaises(OSError, realpath, ABSTFN+"2", strict=True)
438 self.assertRaises(OSError, realpath, ABSTFN+"1/x", strict=True)
439 self.assertRaises(OSError, realpath, ABSTFN+"1/..", strict=True)
440 self.assertRaises(OSError, realpath, ABSTFN+"1/../x", strict=True)
442 self.assertRaises(OSError, realpath,
444 self.assertRaises(OSError, realpath,
448 self.assertRaises(OSError, realpath, ABSTFN+"a", strict=True)
452 self.assertRaises(OSError, realpath, ABSTFN+"c", strict=True)
456 self.assertRaises(OSError, realpath, basename(ABSTFN), strict=True)
474 self.assertEqual(realpath(ABSTFN + '/link'), ABSTFN)
490 self.assertEqual(realpath(ABSTFN + '/%d' % depth), ABSTFN)
494 self.assertEqual(realpath('%d' % depth), ABSTFN)
514 self.assertEqual(realpath("a"), ABSTFN + "/y/a")
538 self.assertEqual(realpath(ABSTFN + "/link-y/.."), ABSTFN + "/k")
541 self.assertEqual(realpath(basename(ABSTFN) + "/link-y/.."),
562 self.assertEqual(realpath(base + "link"), ABSTFN)
563 self.assertEqual(realpath(base + "link/k"), ABSTFN + "/k")
746 self.assertPathEqual(self.path.realpath)