Lines Matching refs:dir
50 def nameCheck(self, name, dir, pre, suf): argument
56 self.assertEqual(os.path.abspath(ndir), os.path.abspath(dir),
57 "file '%s' not in directory '%s'" % (name, dir))
282 dir = tempfile.mkdtemp()
284 with support.swap_attr(tempfile, 'tempdir', dir):
287 support.rmtree(dir)
340 def __init__(self, dir, pre, suf, bin): argument
344 (self.fd, self.name) = tempfile._mkstemp_inner(dir, pre, suf, flags)
353 def do_create(self, dir=None, pre="", suf="", bin=1): argument
354 if dir is None:
355 dir = tempfile.gettempdir()
357 file = self.mkstemped(dir, pre, suf, bin)
361 self.nameCheck(file.name, dir, pre, suf)
380 dir = tempfile.mkdtemp()
382 self.do_create(dir=dir).write("blat")
384 os.rmdir(dir)
468 dir = tempfile.mkdtemp()
469 self.assertTrue(dir.endswith('aaa'))
516 dir = tempfile.gettempdir()
517 self.assertTrue(os.path.isabs(dir) or dir == os.curdir,
518 "%s is not an absolute path" % dir)
519 self.assertTrue(os.path.isdir(dir),
520 "%s is not a directory" % dir)
548 def do_create(self, dir=None, pre="", suf=""): argument
549 if dir is None:
550 dir = tempfile.gettempdir()
552 (fd, name) = tempfile.mkstemp(dir=dir, prefix=pre, suffix=suf)
554 adir = os.path.abspath(dir)
561 self.nameCheck(name, dir, pre, suf)
573 self.do_create(dir=".")
577 dir = tempfile.mkdtemp()
579 self.do_create(dir=dir)
581 os.rmdir(dir)
592 def do_create(self, dir=None, pre="", suf=""): argument
593 if dir is None:
594 dir = tempfile.gettempdir()
596 name = tempfile.mkdtemp(dir=dir, prefix=pre, suffix=suf)
601 self.nameCheck(name, dir, pre, suf)
628 dir = tempfile.mkdtemp()
630 os.rmdir(self.do_create(dir=dir))
632 os.rmdir(dir)
638 dir = self.do_create()
640 mode = stat.S_IMODE(os.stat(dir).st_mode)
650 os.rmdir(dir)
660 dir = tempfile.mkdtemp()
661 self.assertTrue(dir.endswith('bbb'))
682 self.dir = tempfile.mkdtemp()
685 if self.dir:
686 os.rmdir(self.dir)
687 self.dir = None
693 def __init__(self, dir, pre, suf): argument
694 self.name = tempfile.mktemp(dir=dir, prefix=pre, suffix=suf)
704 file = self.mktemped(self.dir, pre, suf)
708 self.nameCheck(file.name, self.dir, pre, suf)
742 def do_create(self, dir=None, pre="", suf="", delete=True): argument
743 if dir is None:
744 dir = tempfile.gettempdir()
746 file = tempfile.NamedTemporaryFile(dir=dir, prefix=pre, suffix=suf,
751 self.nameCheck(file.name, dir, pre, suf)
771 dir = tempfile.mkdtemp()
773 f = tempfile.NamedTemporaryFile(dir=dir)
779 os.rmdir(dir)
783 dir = tempfile.mkdtemp()
786 f = tempfile.NamedTemporaryFile(dir=dir, delete=False)
795 os.rmdir(dir)
838 dir = tempfile.mkdtemp()
839 self.addCleanup(support.rmtree, dir)
841 tempfile.NamedTemporaryFile(mode=(), dir=dir)
842 self.assertEqual(os.listdir(dir), [])
851 def do_create(self, max_size=0, dir=None, pre="", suf=""): argument
852 if dir is None:
853 dir = tempfile.gettempdir()
855 file = tempfile.SpooledTemporaryFile(max_size=max_size, dir=dir, prefix=pre, suffix=suf)
871 dir = tempfile.mkdtemp()
873 f = tempfile.SpooledTemporaryFile(max_size=10, dir=dir)
882 os.rmdir(dir)
1064 dir = tempfile.mkdtemp()
1065 f = tempfile.TemporaryFile(dir=dir)
1071 os.rmdir(dir)
1076 os.rmdir(dir)