Updated config & environment
This commit is contained in:
@@ -13,8 +13,8 @@ class RunTestCase(CommandTestCase):
|
||||
def __init__(self, method_name: str):
|
||||
CommandTestCase.__init__(self, method_name)
|
||||
self._source = "run-test"
|
||||
self._project_file = f"src/{String.convert_to_snake_case(self._source)}/{self._source}.json"
|
||||
self._application = f"src/{String.convert_to_snake_case(self._source)}/application.py"
|
||||
self._project_file = f"src/{String.to_snake_case(self._source)}/{self._source}.json"
|
||||
self._application = f"src/{String.to_snake_case(self._source)}/application.py"
|
||||
self._test_code = f"""
|
||||
import json
|
||||
import os
|
||||
@@ -33,9 +33,9 @@ class RunTestCase(CommandTestCase):
|
||||
"""
|
||||
|
||||
def _get_appsettings(self, is_dev=False):
|
||||
appsettings = f"dist/{self._source}/build/{String.convert_to_snake_case(self._source)}/appsettings.json"
|
||||
appsettings = f"dist/{self._source}/build/{String.to_snake_case(self._source)}/appsettings.json"
|
||||
if is_dev:
|
||||
appsettings = f"src/{String.convert_to_snake_case(self._source)}/appsettings.json"
|
||||
appsettings = f"src/{String.to_snake_case(self._source)}/appsettings.json"
|
||||
|
||||
with open(os.path.join(os.getcwd(), appsettings), "r", encoding="utf-8") as cfg:
|
||||
# load json
|
||||
@@ -46,7 +46,7 @@ class RunTestCase(CommandTestCase):
|
||||
|
||||
def _save_appsettings(self, settings: dict):
|
||||
with open(
|
||||
os.path.join(os.getcwd(), f"src/{String.convert_to_snake_case(self._source)}/appsettings.json"),
|
||||
os.path.join(os.getcwd(), f"src/{String.to_snake_case(self._source)}/appsettings.json"),
|
||||
"w",
|
||||
encoding="utf-8",
|
||||
) as project_file:
|
||||
@@ -72,10 +72,10 @@ class RunTestCase(CommandTestCase):
|
||||
self.assertIn("WasStarted", settings["RunTest"])
|
||||
self.assertEqual("True", settings["RunTest"]["WasStarted"])
|
||||
self.assertNotEqual(
|
||||
os.path.join(os.getcwd(), f"src/{String.convert_to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
os.path.join(os.getcwd(), f"src/{String.to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
)
|
||||
self.assertEqual(
|
||||
os.path.join(os.getcwd(), f"dist/{self._source}/build/{String.convert_to_snake_case(self._source)}"),
|
||||
os.path.join(os.getcwd(), f"dist/{self._source}/build/{String.to_snake_case(self._source)}"),
|
||||
settings["RunTest"]["Path"],
|
||||
)
|
||||
|
||||
@@ -87,10 +87,10 @@ class RunTestCase(CommandTestCase):
|
||||
self.assertIn("WasStarted", settings["RunTest"])
|
||||
self.assertEqual("True", settings["RunTest"]["WasStarted"])
|
||||
self.assertNotEqual(
|
||||
os.path.join(os.getcwd(), f"src/{String.convert_to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
os.path.join(os.getcwd(), f"src/{String.to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
)
|
||||
self.assertEqual(
|
||||
os.path.join(os.getcwd(), f"dist/{self._source}/build/{String.convert_to_snake_case(self._source)}"),
|
||||
os.path.join(os.getcwd(), f"dist/{self._source}/build/{String.to_snake_case(self._source)}"),
|
||||
settings["RunTest"]["Path"],
|
||||
)
|
||||
|
||||
@@ -102,7 +102,7 @@ class RunTestCase(CommandTestCase):
|
||||
self.assertIn("WasStarted", settings["RunTest"])
|
||||
self.assertEqual("True", settings["RunTest"]["WasStarted"])
|
||||
self.assertEqual(
|
||||
os.path.join(os.getcwd(), f"src/{String.convert_to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
os.path.join(os.getcwd(), f"src/{String.to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
)
|
||||
|
||||
def test_run_dev_by_project(self):
|
||||
@@ -113,5 +113,5 @@ class RunTestCase(CommandTestCase):
|
||||
self.assertIn("WasStarted", settings["RunTest"])
|
||||
self.assertEqual("True", settings["RunTest"]["WasStarted"])
|
||||
self.assertEqual(
|
||||
os.path.join(os.getcwd(), f"src/{String.convert_to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
os.path.join(os.getcwd(), f"src/{String.to_snake_case(self._source)}"), settings["RunTest"]["Path"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user