Exemple #1
0
    def test_persons_post(self):
        """Test case for persons_post

        Creates a person.
        """
        person = Person()
        person.username="******"
        response = self.client.open(
            '/persons',
            method='POST',
            data=json.dumps(person),
            content_type='application/json')
        self.assertStatus(response, 204,
                       'Response body is : ' + response.data.decode('utf-8'))
    def test_persons_post(self):
        """Test case for persons_post

        Creates a person
        """
        person = Person()
        response = self.client.open('/openapi101/persons',
                                    method='POST',
                                    data=json.dumps(person),
                                    content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
def operations_person_create_person(body=None):  # noqa: E501
    """operations_person_create_person

    Creates a new Person # noqa: E501

    :param body: 
    :type body: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        body = Person.from_dict(connexion.request.get_json())  # noqa: E501
    return swagger_server.services.person.createperson(body)
Exemple #4
0
    def test_operations_person_create_person(self):
        """Test case for operations_person_create_person

        
        """
        body = Person()
        response = self.client.open(
            '/ASDFOrg/HistoryDB/1.0.0/person',
            method='POST',
            data=json.dumps(body),
            content_type='application/json')
        self.assert200(response,
                       'Response body is : ' + response.data.decode('utf-8'))
Exemple #5
0
def persons_post(person=None):  # noqa: E501
    """Creates a person

    Adds a new person to the persons list. # noqa: E501

    :param person: The person to create.
    :type person: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        person = Person.from_dict(connexion.request.get_json())  # noqa: E501
    return 'do some magic!'
def persons_post(person=None):  # noqa: E501
    """Creates a person.

    Adds a new person to the person list. # noqa: E501

    :param person: The person to create.
    :type person: dict | bytes

    :rtype: None
    """
    if connexion.request.is_json:
        person = Person.from_dict(connexion.request.get_json())  # noqa: E501
    persons_list.append(person)
    return Response(mimetype='application/json', status=204)