Пример #1
0
 def test_dir_empty_with_nonempty_dir_should_return_false(self):
     temp = tempfile.mkdtemp()
     f = open(os.path.join(temp,'afile.txt'),'w')
     f.write('some text')
     f.close()
     self.assertFalse(s2site.dir_empty(temp), 'dir_empty did not return False with non-empty dir.')
     shutil.rmtree(temp)
Пример #2
0
 def test_dir_empty_with_nonempty_dir_should_return_false(self):
     temp = tempfile.mkdtemp()
     f = open(os.path.join(temp, 'afile.txt'), 'w')
     f.write('some text')
     f.close()
     self.assertFalse(s2site.dir_empty(temp),
                      'dir_empty did not return False with non-empty dir.')
     shutil.rmtree(temp)
Пример #3
0
 def test_dir_empty_with_empty_dir_should_return_true(self):
     temp = tempfile.mkdtemp()
     self.assertTrue(s2site.dir_empty(temp),
                     'dir_empty did not return True with empty dir.')
     shutil.rmtree(temp)
Пример #4
0
 def test_dir_empty_with_empty_dir_should_return_true(self):
     temp = tempfile.mkdtemp()
     self.assertTrue(s2site.dir_empty(temp), 'dir_empty did not return True with empty dir.')
     shutil.rmtree(temp)