diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3660aa6..6c66933 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,6 @@ name: Tests on: push: - branches: ['**'] pull_request: branches: [main] jobs: diff --git a/hoverpower/data.py b/hoverpower/data.py index 0e12151..011b7ed 100644 --- a/hoverpower/data.py +++ b/hoverpower/data.py @@ -7,6 +7,7 @@ # be prosecuted under federal law. Its content is company confidential. # ============================================================================= +import glob import os import sys @@ -32,6 +33,8 @@ def no_folder(item) -> bool: return True if item.name == '__pycache__': return True + if not glob.glob(f'{item.path}/*.pdf') + glob.glob(f'{item.path}/*.pdfs'): + return True return False @@ -50,7 +53,8 @@ def log_available_files(package: str): sys.exit(utilo.FAILURE) featurepath = utilo.join(hoverpower.path.STORE, package) # TODO: add recursive feature packages - for item in os.scandir(featurepath): + # TODO: REPLACE WITH UTILO CODE + for item in sorted(os.scandir(featurepath), key=lambda x: x.name): utilo.log(f' {item.name}') diff --git a/pyproject.toml b/pyproject.toml index 07aab6b..fbed104 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ dependencies = [ "resinf>=1.0.4,<2.0.0", "jamer>=1.0.2,<2.0.0", - "utilo>=2.109.0,<3.0.0", + "utilo>=2.110.1,<3.0.0", "cryptography>=38.0.0,<49.0.0", ] keywords = [] @@ -29,7 +29,7 @@ content-type = "text/markdown" [project.optional-dependencies] dev = [ - "utilotest>=1.0.4,<2.0.0", + "utilotest>=1.1.1,<2.0.0", "pdflog==1.0.2", ] diff --git a/tests/test_cli.py b/tests/test_cli.py index 4c62b8f..19d51b0 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -103,3 +103,19 @@ def test_cli_malus_input(cmd, mp): cmd=cmd, mp=mp, ) + + +def test_cli_invalid_reosurce(mp, capsys): + """Invalid list of provides resources. + + Example: + --hoverpower copy data hoverpower + --include copy data include + --lib copy data lib + --lib64 copy data lib64 + --list LIST list all available resources in group + --master copy data master + """ + tests.run(cmd='--help', mp=mp) + stdout = utilotest.stdout(capsys) + assert 'lib64' not in stdout