fix tests

This commit is contained in:
Sina Atalay 2023-10-18 21:08:52 +02:00
parent 8a2045c7a1
commit 504ccd13f4
2 changed files with 14 additions and 4 deletions

View File

@ -1,9 +1,18 @@
import rendercv.__main__ as rendercv
input_file_path = "personal.yaml"
rendercv.main(input_file_path)
# input_file_path = "personal.yaml"
# rendercv.main(input_file_path)
# This script is equivalent to running the following command in the terminal:
# python -m rendercv personal.yaml
# or
# rendercv personal.yaml
# rendercv personal.yaml
from rendercv.data_model import RenderCVDataModel
jsoan = RenderCVDataModel.model_json_schema()
import json
# write json to file
with open("json_schema.json", "w") as f:
f.write(json.dumps(jsoan))

View File

@ -518,7 +518,7 @@ class TestRendering(unittest.TestCase):
# Wrong input:
with self.subTest(msg="Wrong input"):
with self.assertRaises(ValueError, msg="Value error didn't raise."):
with self.assertRaises(subprocess.CalledProcessError):
subprocess.run(
[
sys.executable,
@ -526,4 +526,5 @@ class TestRendering(unittest.TestCase):
"rendercv",
"wrong_input.yaml",
],
check=True,
)