Beispiel #1
0
 def test_clean_paths_directory_recursive(self):
     tempdir = tempfile.mkdtemp()
     
     with open(os.path.join(tempdir, 'lalala.txt'), 'w') as f:
         f.write('foobar')
     
     clean_silent(tempdir)
     assert not os.path.exists(os.path.join(tempdir, 'lalala.txt'))
     assert not os.path.exists(tempdir)
Beispiel #2
0
    def test_clean_paths_directory_recursive(self):
        tempdir = tempfile.mkdtemp()

        with open(os.path.join(tempdir, 'lalala.txt'), 'w') as f:
            f.write('foobar')

        clean_silent(tempdir)
        assert not os.path.exists(os.path.join(tempdir, 'lalala.txt'))
        assert not os.path.exists(tempdir)
Beispiel #3
0
 def test_clean_paths_multiple_files(self):
     l = [
         tempfile.mkstemp()[1],
         tempfile.mkstemp()[1],
         tempfile.mkstemp()[1]
     ]
     
     clean_silent(l)
     
     for x in l:
         assert not os.path.exists(x)
Beispiel #4
0
    def test_clean_paths_multiple_files(self):
        l = [
            tempfile.mkstemp()[1],
            tempfile.mkstemp()[1],
            tempfile.mkstemp()[1]
        ]

        clean_silent(l)

        for x in l:
            assert not os.path.exists(x)
Beispiel #5
0
 def test_clean_paths_empty(self):
     clean_silent([])
     assert True
Beispiel #6
0
 def test_clean_paths_directory(self):
     tempdir = tempfile.mkdtemp()
     
     clean_silent(tempdir)
     assert not os.path.exists(tempdir)
Beispiel #7
0
 def test_clean_paths_file_does_not_exist(self):
     clean_silent(['/tmp/this-file-does-not-exist'])
     assert True
Beispiel #8
0
 def test_clean_paths_empty(self):
     clean_silent([])
     assert True
Beispiel #9
0
    def test_clean_paths_directory(self):
        tempdir = tempfile.mkdtemp()

        clean_silent(tempdir)
        assert not os.path.exists(tempdir)
Beispiel #10
0
 def test_clean_paths_file_does_not_exist(self):
     clean_silent(['/tmp/this-file-does-not-exist'])
     assert True