Able to connect to perform operations on local files
This commit is contained in:
parent
a5c99c2d06
commit
3eb045cd4a
3 changed files with 51 additions and 0 deletions
27
test/losoup/test_local_files.py
Normal file
27
test/losoup/test_local_files.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from losoup.file_operations.local_files import LocalFile
|
||||
from losoup.models import Asset
|
||||
import typer
|
||||
|
||||
|
||||
def test_local_files_init(keepassxc):
|
||||
local_file = LocalFile(keepassxc)
|
||||
assert local_file.software == keepassxc
|
||||
|
||||
|
||||
def test_get_local_files(local_file):
|
||||
assert "KeePassXC-2.7.9-x86_64.AppImage" in local_file.get_files_in_folder()
|
||||
|
||||
|
||||
def test_is_file_present(local_file):
|
||||
assert local_file.is_file_present()
|
||||
|
||||
|
||||
def test_is_file_absent(local_file_not_present):
|
||||
assert local_file_not_present.is_file_absent()
|
||||
|
||||
|
||||
def test_write_file(keepassxc_digest_file: LocalFile, asset_to_write: Asset):
|
||||
assert keepassxc_digest_file.is_file_absent()
|
||||
keepassxc_digest_file.write_file(asset_to_write)
|
||||
assert keepassxc_digest_file.is_file_present()
|
||||
keepassxc_digest_file.delete_file()
|
Loading…
Add table
Add a link
Reference in a new issue