diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b466728..8f0e530 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,9 @@ jobs: with: path: custom + - name: Test python scripts + run: python -m unittest + - name: Set test tag variable as an output id: vars run: echo "tag=testapp_2023.12.1" >> $GITHUB_OUTPUT diff --git a/src/brand.py b/src/brand.py index 26b4a58..0bb45cd 100644 --- a/src/brand.py +++ b/src/brand.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from pathlib import Path INFO_JSON = 'info.json' diff --git a/src/custom_apps.py b/src/custom_apps.py index 78725e1..613679e 100644 --- a/src/custom_apps.py +++ b/src/custom_apps.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from info_parser import InfoParser from brand import Brand import subprocess diff --git a/src/generate_and_download.py b/src/generate_and_download.py index 2ed2a02..f1fbebc 100644 --- a/src/generate_and_download.py +++ b/src/generate_and_download.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + """Generate the custom app plist files, and a custom_project.yml. Based on the arguments passed in: where the subfolder name will become the "brand name" of the custom app. diff --git a/src/info_parser.py b/src/info_parser.py index 96200a8..d6f5a70 100644 --- a/src/info_parser.py +++ b/src/info_parser.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + from urllib.parse import urlparse import json from pathlib import Path diff --git a/src/version.py b/src/version.py index a42ff75..cdcf32d 100644 --- a/src/version.py +++ b/src/version.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import re from datetime import datetime diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..a60ef73 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,2 @@ +import sys +sys.path.insert(0, "src") \ No newline at end of file diff --git a/tests/custom_apps_test.py b/tests/test_custom_apps.py similarity index 94% rename from tests/custom_apps_test.py rename to tests/test_custom_apps.py index 362bc37..a452e2b 100644 --- a/tests/custom_apps_test.py +++ b/tests/test_custom_apps.py @@ -1,5 +1,5 @@ import unittest -from src.custom_apps import CustomApps +from custom_apps import CustomApps from pathlib import Path diff --git a/tests/info_parser_test.py b/tests/test_info_parser.py similarity index 97% rename from tests/info_parser_test.py rename to tests/test_info_parser.py index b35cc38..8b8b886 100644 --- a/tests/info_parser_test.py +++ b/tests/test_info_parser.py @@ -1,5 +1,5 @@ import unittest -from src.info_parser import InfoParser +from info_parser import InfoParser from pathlib import Path import yaml import os @@ -70,3 +70,7 @@ class InfoParserTest(unittest.TestCase): def test_auth_value(self): self.assertEqual(self.parser.download_auth(), os.getenv( "DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION")) + + +if __name__ == '__main__': + unittest.main() \ No newline at end of file diff --git a/tests/version_test.py b/tests/test_version.py similarity index 95% rename from tests/version_test.py rename to tests/test_version.py index 4013399..9b64b7d 100644 --- a/tests/version_test.py +++ b/tests/test_version.py @@ -1,5 +1,5 @@ import unittest -from src.version import Version +from version import Version class VersionTest(unittest.TestCase):