Skip to content

Commit 6e3eca5

Browse files
authored
feat(contact): add extra message (#49)
* feat(contact): add extra message
1 parent 76a2041 commit 6e3eca5

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Python
1+
name: Python test
22

33
on:
44
push
55

66
jobs:
7-
build:
7+
run-tests:
88
runs-on: ubuntu-22.04
99
steps:
1010
- uses: actions/checkout@v3

moira_client/models/contact.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, value='', type='', **kwargs):
2424
self.name = kwargs.get('name', None)
2525
self._id = kwargs.get('id', None)
2626
self.team_id = kwargs.get('team_id', None)
27+
self.extra_message = kwargs.get('extra_message', None)
2728

2829

2930
class ContactManager:

moira_client/models/team/contact/_managers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def create(self, team_id: str, contact: Contact) -> Contact:
1313
"name": contact.name,
1414
"type": contact.type,
1515
"value": contact.value,
16+
"extra_message": contact.extra_message,
1617
}
1718

1819
response = self._client.post(self._full_path(team_id), json=payload)

tests/models/team/contact/test_managers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def _request_data(self) -> dict:
1818
"team_id": "string",
1919
"type": "mail",
2020
"value": "devops@example.com",
21+
"extra_message": "string",
2122
}
2223

2324
@property
@@ -29,6 +30,7 @@ def _response_data(self) -> dict:
2930
"type": "mail",
3031
"user": "",
3132
"value": "devops@example.com",
33+
"extra_message": "string",
3234
}
3335

3436
@property
@@ -59,3 +61,4 @@ def test_create(self) -> None:
5961
assert response.type == self._response_data["type"]
6062
assert response.user == self._response_data["user"]
6163
assert response.value == self._response_data["value"]
64+
assert response.extra_message == self._response_data["extra_message"]

0 commit comments

Comments
 (0)