Lines Matching full:filename
21 def remove_if_exists(filename): argument
22 if os.path.exists(filename):
23 os.unlink(filename)
29 # Do all the tests we can given only a single filename. The file should
31 def _do_single(self, filename): argument
32 self.assertTrue(os.path.exists(filename))
33 self.assertTrue(os.path.isfile(filename))
34 self.assertTrue(os.access(filename, os.R_OK))
35 self.assertTrue(os.path.exists(os.path.abspath(filename)))
36 self.assertTrue(os.path.isfile(os.path.abspath(filename)))
37 self.assertTrue(os.access(os.path.abspath(filename), os.R_OK))
38 os.chmod(filename, 0o777)
39 os.utime(filename, None)
40 os.utime(filename, (time.time(), time.time()))
41 # Copy/rename etc tests using the same filename
42 self._do_copyish(filename, filename)
43 # Filename should appear in glob output
45 os.path.abspath(filename)==os.path.abspath(glob.glob(glob.escape(filename))[0]))
47 path, base = os.path.split(os.path.abspath(filename))
104 def _test_single(self, filename): argument
105 remove_if_exists(filename)
106 create_empty_file(filename)
108 self._do_single(filename)
110 os.unlink(filename)
111 self.assertTrue(not os.path.exists(filename))
113 f = os.open(filename, os.O_CREAT | os.O_WRONLY)
116 self._do_single(filename)
118 os.unlink(filename)
121 # _test functions with each of the filename combinations we wish to test