-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test using include_files option
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
tests/job_tests/download_file_bundle_incl_files_1/outputs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
|
||
from kiara.models.filesystem import KiaraFileBundle | ||
from kiara.models.values.value import Value | ||
|
||
|
||
def check_downloaded_files(file_bundle: Value): | ||
|
||
assert ( | ||
file_bundle.data_type_name == "file_bundle" | ||
), f"Expected a file_bundle value, got: {file_bundle.data_type_name}" | ||
assert ( | ||
file_bundle.value_size < 400000 | ||
), f"Expected a file_bundle value with size < 400000, got: {file_bundle.value_size}" | ||
|
||
assert ( | ||
file_bundle.value_size > 20000 | ||
), f"Expected a file_bundle value with size < 20000, got: {file_bundle.value_size}" | ||
|
||
kiara_file_bundle: KiaraFileBundle = file_bundle.data | ||
assert ( | ||
kiara_file_bundle.__class__ == KiaraFileBundle | ||
), f"Expected a KiaraFileBundle object, got: {kiara_file_bundle.__class__}" | ||
|
||
assert ( | ||
f"kiara_plugin.core_types-main{os.path.sep}.gitignore" | ||
not in kiara_file_bundle.included_files.keys() | ||
), f"Expected 'kiara_plugin.core_types-main{os.path.sep}.gitignore' in included files" | ||
|
||
assert ( | ||
f"kiara_plugin.core_types-develop{os.path.sep}.cruft.json" | ||
in kiara_file_bundle.included_files.keys() | ||
), f"Expected 'kiara_plugin.core_types-develop{os.path.sep}.cruft.json' in included files" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
operation: download.file_bundle | ||
inputs: | ||
url: https://github.com/DHARPA-Project/kiara_plugin.core_types/archive/refs/heads/develop.zip | ||
include_files: | ||
- json |