Skip to content

Commit d06203f

Browse files
mcurlejfrenzymadness
authored andcommitted
Fixes #14
+ added types to tests
1 parent 743ae74 commit d06203f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

joft/models.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def __post_init__(self, reuse_data):
9595
class JiraTemplate:
9696
api_version: int
9797
kind: str
98-
metadata: typing.Dict[str, str]
9998

10099
# initvars
101100
actions: dataclasses.InitVar[typing.List[typing.Dict[str, typing.Any]]]
@@ -106,6 +105,8 @@ class JiraTemplate:
106105
CreateTicketAction | UpdateTicketAction | LinkIssuesAction | TransitionAction
107106
] = dataclasses.field(default_factory=list)
108107

108+
metadata: typing.Dict[str, str] | None = None
109+
109110
def __post_init__(self, actions, trigger) -> None:
110111
if trigger:
111112
self.jira_search: Trigger = Trigger(**trigger)

tests/test_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def test_load_invalid_yaml_raise() -> None:
2929

3030
@unittest.mock.patch("joft.utils.pathlib.Path.cwd")
3131
@unittest.mock.patch("joft.utils.platformdirs")
32-
def test_load_toml_app_config(mock_platformdirs, mock_cwd):
32+
def test_load_toml_app_config(mock_platformdirs, mock_cwd) -> None:
3333
"""Test if we can find the app config file in one of the platform dirs"""
3434
hostname = "test"
3535
pat_token = "pat_token"
@@ -60,7 +60,7 @@ def test_load_toml_app_config(mock_platformdirs, mock_cwd):
6060

6161
@unittest.mock.patch("joft.utils.pathlib.Path.cwd")
6262
@unittest.mock.patch("joft.utils.platformdirs")
63-
def test_load_toml_app_config_no_config_found(mock_platformdirs, mock_cwd):
63+
def test_load_toml_app_config_no_config_found(mock_platformdirs, mock_cwd) -> None:
6464
"""
6565
Test that we will end with a non-zero error code when there is no config present and
6666
printing a message on the stdout.

0 commit comments

Comments
 (0)