Exemple #1
0
 def execute(self):
     try:
         json_obj = PostRequest(connection=self.connection,
                                context=f"{self.CONTEXT}/form").execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError("Error creating work package form") from re
 def execute(self):
     try:
         json_obj = PostRequest(connection=self.connection,
                                context=f"{self.CONTEXT}/form",
                                json=self.form.__dict__).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError("Error updating version form") from re
 def setUp(self):
     super().setUp()
     TIME_ENTRY = os.path.join(self.TEST_CASES, '../data/time_entry.json')
     TIME_ENTRY_INPUT = os.path.join(self.TEST_CASES, '../data/inputs/time_entry_form.json')
     self.tEntryReq = self.op.get_time_entry_service()
     with open(TIME_ENTRY) as f:
         self.time_entry = TimeEntry(json.load(f))
     with open(TIME_ENTRY_INPUT) as f:
         self.time_entry_form = Form(json.load(f))
Exemple #4
0
 def execute(self):
     try:
         json_obj = PostRequest(connection=self.connection,
                                headers={"Content-Type": "application/json"},
                                context=f"{self.CONTEXT}/form",
                                json=self.form).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError(f"Error creating form: {self.form}") from re
 def execute(self):
     try:
         json_obj = PostRequest(connection=self.connection,
                                # context=f"{self.CONTEXT}/:{self.time_entry}/form",
                                context=f"{self.CONTEXT}/form",
                                json=self.form.__dict__).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError(f"Error updating form: {self.form.name}") from re
Exemple #6
0
 def setUp(self):
     super().setUp()
     RELATION = os.path.join(self.TEST_CASES, '../data/relation.json')
     self.relationSer = self.op.get_relation_service()
     with open(RELATION) as f:
         self.relation = Relation(json.load(f))
     FORM = os.path.join(self.TEST_CASES, '../data/form.json')
     with open(FORM) as f:
         self.form = Form(json.load(f))
Exemple #7
0
 def execute(self):
     try:
         json_obj = PostRequest(connection=self.connection,
                                headers={"Content-Type": "application/json"},
                                context=f"{self.CONTEXT}/form",
                                json=self.membership.__dict__).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError(f"Error creating form from membership "
                             f"'{self.membership.__dict__['_links']['self']['href']}'") from re
 def setUp(self):
     super().setUp()
     DATA = os.path.join(self.TEST_CASES, '../data/inputs/query.json')
     self.querySer = self.op.get_query_service()
     with open(DATA) as f:
         self.query = Query(json.load(f))
     QUERY_FORM = os.path.join(self.TEST_CASES,
                               '../data/inputs/query_form.json')
     with open(QUERY_FORM) as f:
         self.query_form = Form(json.load(f))
 def execute(self):
     try:
         json_obj = PostRequest(connection=self.connection,
                                headers={
                                    "Content-Type": "application/hal+json"
                                },
                                context=f"{self.CONTEXT}form").execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError("Error creating work package form") from re
 def execute(self):
     try:
         membership_id = self.membership.id
         self.__remove_readonly_attributes()
         json_obj = PostRequest(connection=self.connection,
                                headers={"Content-Type": "application/json"},
                                context=f"{self.CONTEXT}/{membership_id}/form",
                                json=self.membership.__dict__).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError("Error updating membership form") from re
Exemple #11
0
 def execute(self):
     try:
         json_obj = PostRequest(
             connection=self.connection,
             context=f"{self.CONTEXT}/{self.work_package.id}/form",
             json=json.dumps(self.relation.__dict__)).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError(
             f"Error creating relation for work package {self.work_package.id}"
         ) from re
Exemple #12
0
 def execute(self):
     try:
         json_obj = PostRequest(
             connection=self.connection,
             headers={
                 "Content-Type": "application/json"
             },
             context=f"{self.CONTEXT}/{self.project.id}/form",
             json=self.project.__dict__).execute()
         return Form(json_obj)
     except RequestError as re:
         raise BusinessError(
             f"Error updating project form {self.project.name}") from re
Exemple #13
0
 def setUp(self):
     super().setUp()
     WORK_PACKAGE = os.path.join(self.TEST_CASES,
                                 '../data/work_package.json')
     WORK_PACKAGE_FORM = os.path.join(self.TEST_CASES,
                                      '../data/work_package_form.json')
     RELATION = os.path.join(self.TEST_CASES, '../data/relation.json')
     USER = os.path.join(self.TEST_CASES, '../data/user.json')
     ACTIVITY = os.path.join(self.TEST_CASES, '../data/activity.json')
     ATTACHMENT = os.path.join(self.TEST_CASES, '../data/attachment.json')
     self.wpSer = self.op.get_work_package_service()
     with open(WORK_PACKAGE) as f:
         self.work_package = WorkPackage(json.load(f))
     with open(WORK_PACKAGE_FORM) as f:
         self.work_package_form = Form(json.load(f))
     with open(RELATION) as f:
         self.relation = WorkPackage(json.load(f))
     with open(USER) as f:
         self.watcher = User(json.load(f))
     with open(ACTIVITY) as f:
         self.activity = WorkPackage(json.load(f))
     with open(ATTACHMENT) as f:
         self.attachment = WorkPackage(json.load(f))