def test_get_available_size(): f = file.File("1.txt", "Пис") fs = file_storage.FileStorage(5) fs.write(f) assert fs.get_available_size() == 2
def test_get_max_size(): fs = file_storage.FileStorage(5) assert fs.get_max_size() == 5
def test_get_files(): f = file.File("1.txt", "Пис") fs = file_storage.FileStorage(5) fs.write(f) assert fs.get_files == fs._files
def test_get_file2(): f = file.File("1.txt", "Пис") fs = file_storage.FileStorage(5) fs.write(f) assert fs.get_file("2.txt") is None
def test_write1(): f = file.File("1x.txt", "Письмо") fs = file_storage.FileStorage(5) assert fs.write(f) is False
def test_delete2(): fs = file_storage.FileStorage(5) assert fs.delete("1.txt") is False
def test_delete(): f = file.File("1.txt", "Пис") fs = file_storage.FileStorage(5) fs.write(f) assert fs.delete("1.txt") is True
def tets_is_exist2(): f = file.File("", "Пис") fs = file_storage.FileStorage(5) fs.write(f) assert fs.is_exists("1.txt") is False
def test_is_exist1(): f = file.File("1.txt", "Пис") fs = file_storage.FileStorage(5) fs.write(f) assert fs.is_exists("1.txt") is True
def test_write2(): f = file.File("1x.txt", "Пис") fs = file_storage.FileStorage(5) assert fs.write(f) is True
def setUp(self): self.maxDiff = None self.test_dir = os.path.join(os.path.dirname(__file__), 'testdata') self.file_storage = file_storage.FileStorage(self.test_dir) self.file_storage.scan()