Пример #1
0
def test_get_available_size():
    f = file.File("1.txt", "Пис")
    fs = file_storage.FileStorage(5)
    fs.write(f)
    assert fs.get_available_size() == 2
Пример #2
0
def test_get_max_size():
    fs = file_storage.FileStorage(5)

    assert fs.get_max_size() == 5
Пример #3
0
def test_get_files():
    f = file.File("1.txt", "Пис")
    fs = file_storage.FileStorage(5)
    fs.write(f)
    assert fs.get_files == fs._files
Пример #4
0
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
Пример #5
0
def test_write1():
    f = file.File("1x.txt", "Письмо")
    fs = file_storage.FileStorage(5)
    assert fs.write(f) is False
Пример #6
0
def test_delete2():
    fs = file_storage.FileStorage(5)
    assert fs.delete("1.txt") is False
Пример #7
0
def test_delete():
    f = file.File("1.txt", "Пис")
    fs = file_storage.FileStorage(5)
    fs.write(f)
    assert fs.delete("1.txt") is True
Пример #8
0
def tets_is_exist2():
    f = file.File("", "Пис")
    fs = file_storage.FileStorage(5)
    fs.write(f)
    assert fs.is_exists("1.txt") is False
Пример #9
0
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
Пример #10
0
def test_write2():
    f = file.File("1x.txt", "Пис")
    fs = file_storage.FileStorage(5)
    assert fs.write(f) is True
Пример #11
0
 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()