Fix unittests

This commit is contained in:
Balazs Perlaki-Horvath 2024-02-14 09:31:32 +01:00
parent 3232db9da0
commit 4a50b0986a
10 changed files with 22 additions and 3 deletions

View File

@ -32,6 +32,9 @@ jobs:
with: with:
path: custom path: custom
- name: Test python scripts
run: python -m unittest
- name: Set test tag variable as an output - name: Set test tag variable as an output
id: vars id: vars
run: echo "tag=testapp_2023.12.1" >> $GITHUB_OUTPUT run: echo "tag=testapp_2023.12.1" >> $GITHUB_OUTPUT

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
from pathlib import Path from pathlib import Path
INFO_JSON = 'info.json' INFO_JSON = 'info.json'

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
from info_parser import InfoParser from info_parser import InfoParser
from brand import Brand from brand import Brand
import subprocess import subprocess

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
"""Generate the custom app plist files, and a custom_project.yml. """Generate the custom app plist files, and a custom_project.yml.
Based on the arguments passed in: Based on the arguments passed in:
where the subfolder name will become the "brand name" of the custom app. where the subfolder name will become the "brand name" of the custom app.

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
from urllib.parse import urlparse from urllib.parse import urlparse
import json import json
from pathlib import Path from pathlib import Path

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python3
import re import re
from datetime import datetime from datetime import datetime

2
tests/__init__.py Normal file
View File

@ -0,0 +1,2 @@
import sys
sys.path.insert(0, "src")

View File

@ -1,5 +1,5 @@
import unittest import unittest
from src.custom_apps import CustomApps from custom_apps import CustomApps
from pathlib import Path from pathlib import Path

View File

@ -1,5 +1,5 @@
import unittest import unittest
from src.info_parser import InfoParser from info_parser import InfoParser
from pathlib import Path from pathlib import Path
import yaml import yaml
import os import os
@ -70,3 +70,7 @@ class InfoParserTest(unittest.TestCase):
def test_auth_value(self): def test_auth_value(self):
self.assertEqual(self.parser.download_auth(), os.getenv( self.assertEqual(self.parser.download_auth(), os.getenv(
"DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION")) "DWDS_HTTP_BASIC_ACCESS_AUTHENTICATION"))
if __name__ == '__main__':
unittest.main()

View File

@ -1,5 +1,5 @@
import unittest import unittest
from src.version import Version from version import Version
class VersionTest(unittest.TestCase): class VersionTest(unittest.TestCase):