def test_add_contact(self): """Test case for add_contact Add a new contact """ body = Contact() response = self.client.open('/v1/contacts', method='POST', data=json.dumps(body), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8'))
def test_update_contact(self): """Test case for update_contact Updates a contact in the store with form data """ body = Contact() response = self.client.open( '/v1/contact/{contactId}'.format(contactId='contactId_example'), method='POST', data=json.dumps(body), content_type='application/json') self.assert200(response, 'Response body is : ' + response.data.decode('utf-8'))
def add_contact(body=None): # noqa: E501 """Add a new contact description for add new contact # noqa: E501 :param body: Contact object that needs to be added to the store :type body: dict | bytes :rtype: None """ if connexion.request.is_json: body = Contact.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!'
def projects_id_contacts_put(id, project): """ You can't put the entire List :param id: Project id :type id: int :param project: The contact you want to update :type project: dict | bytes :rtype: None """ if connexion.request.is_json: project = Contact.from_dict(connexion.request.get_json()) return 'do some magic!'
def projects_id_contacts_post(id, project): """ Add a new contact :param id: Project id :type id: int :param project: The comment you want to create :type project: dict | bytes :rtype: Message """ if connexion.request.is_json: project = Contact.from_dict(connexion.request.get_json()) return 'do some magic!'
def test_projects_id_contacts_put(self): """ Test case for projects_id_contacts_put You can't put the entire List """ project = Contact() response = self.client.open( '/project-tracker/projects/{id}/contacts'.format(id=56), method='PUT', data=json.dumps(project), content_type='application/json') self.assert200(response, "Response body is : " + response.data.decode('utf-8'))
def update_contact(contactId, body=None): # noqa: E501 """Updates a contact in the store with form data # noqa: E501 :param contactId: ID of contact that needs to be updated :type contactId: str :param body: Contact object that needs to be added to the store :type body: dict | bytes :rtype: None """ if connexion.request.is_json: body = Contact.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!'