예제 #1
0
 def test_create_project(self):
     object = ProjectConfig(faker.word())
     httpretty.register_uri(httpretty.POST,
                            ProjectClient._build_url(
                                self.client.base_url,
                                ProjectClient.ENDPOINT),
                            body=json.dumps(object.to_dict()),
                            content_type='application/json',
                            status=200)
     result = self.client.create_project(object)
     assert result.to_dict() == object.to_dict()
예제 #2
0
 def test_update_project(self):
     object = ProjectConfig(faker.word())
     project_uuid = uuid.uuid4().hex
     httpretty.register_uri(httpretty.PATCH,
                            ProjectClient._build_url(
                                self.client.base_url,
                                ProjectClient.ENDPOINT, project_uuid),
                            body=json.dumps(object.to_dict()),
                            content_type='application/json',
                            status=200)
     result = self.client.update_project(project_uuid, {'name': 'new'})
     assert result.to_dict() == object.to_dict()