##// END OF EJS Templates
atomictempfile: remove test ordering...
Martijn Pieters -
r29392:f21286e4 default
parent child Browse files
Show More
@@ -19,7 +19,7 b' class testatomictempfile(unittest.TestCa'
19 def tearDown(self):
19 def tearDown(self):
20 shutil.rmtree(self._testdir, True)
20 shutil.rmtree(self._testdir, True)
21
21
22 def test1_simple(self):
22 def testsimple(self):
23 file = atomictempfile(self._filename)
23 file = atomictempfile(self._filename)
24 self.assertFalse(os.path.isfile(self._filename))
24 self.assertFalse(os.path.isfile(self._filename))
25 tempfilename = file._tempname
25 tempfilename = file._tempname
@@ -34,7 +34,7 b' class testatomictempfile(unittest.TestCa'
34 os.path.join(self._testdir, '.testfilename-*')))
34 os.path.join(self._testdir, '.testfilename-*')))
35
35
36 # discard() removes the temp file without making the write permanent
36 # discard() removes the temp file without making the write permanent
37 def test2_discard(self):
37 def testdiscard(self):
38 file = atomictempfile(self._filename)
38 file = atomictempfile(self._filename)
39 (dir, basename) = os.path.split(file._tempname)
39 (dir, basename) = os.path.split(file._tempname)
40
40
@@ -46,11 +46,11 b' class testatomictempfile(unittest.TestCa'
46
46
47 # if a programmer screws up and passes bad args to atomictempfile, they
47 # if a programmer screws up and passes bad args to atomictempfile, they
48 # get a plain ordinary TypeError, not infinite recursion
48 # get a plain ordinary TypeError, not infinite recursion
49 def test3_oops(self):
49 def testoops(self):
50 self.assertRaises(TypeError, atomictempfile)
50 self.assertRaises(TypeError, atomictempfile)
51
51
52 # checkambig=True avoids ambiguity of timestamp
52 # checkambig=True avoids ambiguity of timestamp
53 def test4_checkambig(self):
53 def testcheckambig(self):
54 def atomicwrite(checkambig):
54 def atomicwrite(checkambig):
55 f = atomictempfile(self._filename, checkambig=checkambig)
55 f = atomictempfile(self._filename, checkambig=checkambig)
56 f.write('FOO')
56 f.write('FOO')
General Comments 0
You need to be logged in to leave comments. Login now