Exemplo n.º 1
0
    def move(self, card_id, payload):
        url = MOVE_URL.format(protocol=self.protocol, host_name=self.host_name)
        response = self.req_session.post(url,
                                         json=payload,
                                         headers=self.headers)

        dct_expected = payload['destination']

        self.verify_move(card_id, response, dct_expected)
        DataStore.update(Card.tbl_name, dct_expected, id=card_id)
        print("*****LK_CARD TABLE*****\n", DataStore.read_all('LK_Card'))
Exemplo n.º 2
0
    def update(self, payload):
        soap_update_action, soap_payload = self.payload_gen.get_soap_details(
            'project', 'update', payload)
        soap = self.initialize_soap_request(self.cert, soap_payload,
                                            soap_update_action)
        response = self.request.post(self.soap_wsdl,
                                     soap.body,
                                     soap.header,
                                     encoding='utf-8')

        project_key = self.verify_create_update(response, dct_expected=payload)
        DataStore.update(Project.tbl_name, payload, id=project_key)

        print("*****PRM_PROJECT TABLE*****\n",
              DataStore.read_all('PRM_Project'))
        return response
Exemplo n.º 3
0
    def update(self, card_id, payload):
        update_url = UPDATE_READ_DEL_URL.format(protocol=self.protocol,
                                                host_name=self.host_name,
                                                card_id=card_id)
        response = self.req_session.patch(update_url,
                                          json=payload,
                                          headers=self.headers)

        expected_dct = {}
        for dct in payload:
            expected_key = dct['path'].split('/')[-1]
            expected_value = dct['value']
            expected_dct[expected_key] = expected_value

        self.verify_create_update(response, expected_dct)

        if 'title' in expected_dct:
            dct_update_ds = {'name': expected_dct['title']}
            DataStore.update(Card.tbl_name, dct_update_ds, id=card_id)
        else:
            DataStore.update(Card.tbl_name, expected_dct, id=card_id)

        print("*****LK_CARD TABLE*****\n", DataStore.read_all('LK_Card'))
Exemplo n.º 4
0
def update_external_id(table, external_id, project_key):
    dct_update = {'external_id': external_id}
    DataStore.update(table, dct_update, id=project_key)