Skip to content

Commit

Permalink
test: add test using include_files option
Browse files Browse the repository at this point in the history
  • Loading branch information
makkus committed Apr 17, 2024
1 parent 12e41d3 commit 5a23d45
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/job_tests/download_file_bundle_incl_files_1/outputs.py
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"
5 changes: 5 additions & 0 deletions tests/resources/jobs/download_file_bundle_incl_files_1.yaml
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

0 comments on commit 5a23d45

Please sign in to comment.