Пример #1
0
 def test_rm_if_exists(self):
     tmp_foo = os.path.join(self.temp_dir, 'foo')
     os.mkdir(tmp_foo)
     tmp_foo_bar = os.path.join(self.temp_dir, 'foo', 'bar')
     write_file_contents(tmp_foo_bar, "BAR")
     rm_if_exists(tmp_foo_bar)
     ok_(not os.path.exists(tmp_foo_bar))
Пример #2
0
 def test_rm_if_exists(self):
     tmp_foo = os.path.join(self.temp_dir, 'foo')
     os.mkdir(tmp_foo)
     tmp_foo_bar = os.path.join(self.temp_dir, 'foo', 'bar')
     write_file_contents(tmp_foo_bar, "BAR")
     rm_if_exists(tmp_foo_bar)
     ok_(not os.path.exists(tmp_foo_bar))
Пример #3
0
 def test_rm_if_exists_should_raise_exception_with_dir(self):
     tmp_foo = os.path.join(self.temp_dir, 'foo')
     os.mkdir(tmp_foo)
     rm_if_exists(tmp_foo)
Пример #4
0
 def test_rm_if_exists_should_raise_exception_with_dir(self):
     tmp_foo = os.path.join(self.temp_dir, 'foo')
     os.mkdir(tmp_foo)
     rm_if_exists(tmp_foo)