pam-python 0.1.12__tar.gz → 0.1.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pam_python-0.1.12/pam_python.egg-info → pam_python-0.1.14}/PKG-INFO +1 -1
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/cli.py +2 -34
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/init/pylintrc.tmpl +1 -1
- pam_python-0.1.14/pam/templates/init/run_test.sh +1 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/service/service.test.tmpl +1 -1
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/service/service_class.tmpl +1 -1
- {pam_python-0.1.12 → pam_python-0.1.14/pam_python.egg-info}/PKG-INFO +1 -1
- {pam_python-0.1.12 → pam_python-0.1.14}/pam_python.egg-info/SOURCES.txt +1 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/setup.py +1 -1
- {pam_python-0.1.12 → pam_python-0.1.14}/LICENSE.txt +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/README.md +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/__init__.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/api.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/interface_task_manager.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/models/__init__.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/models/request_command.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/server.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/service.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/task_manager.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/temp_file_utils.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/buildcmd/pamb +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/buildcmd/pamb-base.sh +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/docker/Dockerfile +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/init/dockerignore.tmpl +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/init/gitignore.tmpl +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/init/main.tmpl +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/service/functions.tmpl +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/templates/service/service.yaml +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/tester_task.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam/utils.py +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam_python.egg-info/dependency_links.txt +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam_python.egg-info/entry_points.txt +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam_python.egg-info/requires.txt +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/pam_python.egg-info/top_level.txt +0 -0
- {pam_python-0.1.12 → pam_python-0.1.14}/setup.cfg +0 -0
|
@@ -2,7 +2,6 @@ import os
|
|
|
2
2
|
import sys
|
|
3
3
|
import re
|
|
4
4
|
import shutil
|
|
5
|
-
import glob
|
|
6
5
|
import subprocess
|
|
7
6
|
import pkg_resources
|
|
8
7
|
|
|
@@ -21,42 +20,9 @@ def main():
|
|
|
21
20
|
if create_type == "service":
|
|
22
21
|
name = args[2]
|
|
23
22
|
create_service(name)
|
|
24
|
-
elif cmd == "test":
|
|
25
|
-
if len(args) < 2:
|
|
26
|
-
print("Usage: pam test <modulename>")
|
|
27
|
-
return
|
|
28
|
-
module_name = args[1]
|
|
29
|
-
test_module(module_name)
|
|
30
23
|
else:
|
|
31
24
|
print(f"Unknown command: {args.command}")
|
|
32
25
|
|
|
33
|
-
def test_module(module_name):
|
|
34
|
-
"""Run all test files matching '*.test.py' in the specified module directory."""
|
|
35
|
-
# Locate all test files in the module directory
|
|
36
|
-
test_files = glob.glob(f"{module_name}/*.test.py")
|
|
37
|
-
|
|
38
|
-
if not test_files:
|
|
39
|
-
print(f"Error: No test files found in module '{module_name}' (expected '*.test.py').")
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
print(f"Found {len(test_files)} test file(s) in '{module_name}':")
|
|
43
|
-
for test_file in test_files:
|
|
44
|
-
print(f" - {test_file}")
|
|
45
|
-
|
|
46
|
-
# Run each test file
|
|
47
|
-
for test_file in test_files:
|
|
48
|
-
print(f"\nRunning tests in {test_file}...")
|
|
49
|
-
result = subprocess.run([sys.executable, test_file], capture_output=True, text=True, check=True)
|
|
50
|
-
|
|
51
|
-
print("\nTest Output:")
|
|
52
|
-
print(result.stdout)
|
|
53
|
-
if result.stderr:
|
|
54
|
-
print("\nErrors:")
|
|
55
|
-
print(result.stderr)
|
|
56
|
-
print("-" * 40) # Separator for clarity
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
26
|
def to_pascal_case(input_string: str) -> str:
|
|
61
27
|
"""
|
|
62
28
|
Convert a string to PascalCase.
|
|
@@ -122,6 +88,8 @@ def init_project():
|
|
|
122
88
|
cpy("init/pylintrc.tmpl", ".pylintrc")
|
|
123
89
|
cpy("init/gitignore.tmpl", ".gitignore")
|
|
124
90
|
cpy("init/dockerignore.tmpl", ".dockerignore")
|
|
91
|
+
cpy("init/run_test.sh", "run_unit_test.sh")
|
|
92
|
+
|
|
125
93
|
|
|
126
94
|
if not os.path.exists("requirements.txt"):
|
|
127
95
|
open("requirements.txt", 'a', encoding='utf-8').close()
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
[MESSAGES CONTROL]
|
|
2
|
-
disable=missing-function-docstring,missing-class-docstring,missing-module-docstring,trailing-whitespace,line-too-long,missing-final-newline,broad-exception-caught
|
|
2
|
+
disable=missing-function-docstring,missing-class-docstring,missing-module-docstring,trailing-whitespace,line-too-long,missing-final-newline,broad-exception-caught,invalid-name
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
python -m unittest discover
|
|
@@ -4,7 +4,7 @@ from pam.utils import log
|
|
|
4
4
|
#pylint: disable=import-error
|
|
5
5
|
from .functions import create_report, load_csv_file
|
|
6
6
|
|
|
7
|
-
class #CLASS_NAME#
|
|
7
|
+
class #CLASS_NAME#(Service):
|
|
8
8
|
|
|
9
9
|
#pylint: disable=useless-parent-delegation
|
|
10
10
|
def __init__(self, task_manager, req):
|
|
@@ -20,6 +20,7 @@ pam/templates/init/dockerignore.tmpl
|
|
|
20
20
|
pam/templates/init/gitignore.tmpl
|
|
21
21
|
pam/templates/init/main.tmpl
|
|
22
22
|
pam/templates/init/pylintrc.tmpl
|
|
23
|
+
pam/templates/init/run_test.sh
|
|
23
24
|
pam/templates/service/functions.tmpl
|
|
24
25
|
pam/templates/service/service.test.tmpl
|
|
25
26
|
pam/templates/service/service.yaml
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|