mirror of
https://github.com/kiwix/kiwix-apple-custom.git
synced 2025-09-08 22:58:49 -04:00
Fix unittests
This commit is contained in:
parent
3232db9da0
commit
4a50b0986a
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -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
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
INFO_JSON = 'info.json'
|
INFO_JSON = 'info.json'
|
||||||
|
@ -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
|
||||||
|
@ -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.
|
||||||
|
@ -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
|
||||||
|
@ -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
2
tests/__init__.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
import sys
|
||||||
|
sys.path.insert(0, "src")
|
@ -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
|
||||||
|
|
||||||
|
|
@ -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()
|
@ -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):
|
Loading…
x
Reference in New Issue
Block a user