(self)
| 749 | self.assertEqual(self._box.list_folders(), []) |
| 750 | |
| 751 | def test_clean(self): |
| 752 | # Remove old files from 'tmp' |
| 753 | foo_path = os.path.join(self._path, 'tmp', 'foo') |
| 754 | bar_path = os.path.join(self._path, 'tmp', 'bar') |
| 755 | with open(foo_path, 'w', encoding='utf-8') as f: |
| 756 | f.write("@") |
| 757 | with open(bar_path, 'w', encoding='utf-8') as f: |
| 758 | f.write("@") |
| 759 | self._box.clean() |
| 760 | self.assertTrue(os.path.exists(foo_path)) |
| 761 | self.assertTrue(os.path.exists(bar_path)) |
| 762 | foo_stat = os.stat(foo_path) |
| 763 | os.utime(foo_path, (time.time() - 129600 - 2, |
| 764 | foo_stat.st_mtime)) |
| 765 | self._box.clean() |
| 766 | self.assertFalse(os.path.exists(foo_path)) |
| 767 | self.assertTrue(os.path.exists(bar_path)) |
| 768 | |
| 769 | def test_create_tmp(self, repetitions=10): |
| 770 | # Create files in tmp directory |
nothing calls this directly
no test coverage detected