예제 #1
0
    def test_compare_pn_release_before_cancelling_and_after_cancelling_27594_3(
            self, country, language, instance, cassandra_username, cassandra_password, pmd):
        pn = PN(
            payload=None,
            lang=language,
            country=country,
            instance=instance,
            cassandra_username=cassandra_username,
            cassandra_password=cassandra_password,
            pmd=pmd
        )
        create_pn_response = pn.insert_pn_obligatory_update()
        pn_release_before_cancelling = requests.get(url=create_pn_response[9]).json()
        pn.cancel_pn(
            cp_id=create_pn_response[4],
            pn_id=create_pn_response[5],
            pn_token=create_pn_response[6]
        )
        cancel_pn_response = pn.get_message_from_kafka()
        pn_record_after_cancelling = requests.get(url=cancel_pn_response['data']['url']).json()['records']
        actual_releases_list = list()
        for d in pn_record_after_cancelling:
            for d_1 in d["compiledRelease"]["relatedProcesses"]:
                if d_1["relationship"] == ["planning"]:
                    actual_releases_list.append(d_1)
        pn_release_after_cancelling = requests.get(url=actual_releases_list[0]["uri"]).json()
        expected_result = {
            'values_changed': {
                "root['releases'][0]['id']": {
                    'new_value': f"{pn_release_after_cancelling['releases'][0]['ocid']}-"
                                 f"{pn_release_after_cancelling['releases'][0]['id'][46:59]}",
                    'old_value': f"{pn_release_before_cancelling['releases'][0]['ocid']}-"
                                 f"{pn_release_before_cancelling['releases'][0]['id'][46:59]}"
                },
                "root['releases'][0]['date']": {
                    'new_value': pn_release_after_cancelling['releases'][0]['date'],
                    'old_value': pn_release_before_cancelling['releases'][0]['date']
                },
                "root['releases'][0]['tag'][0]": {
                    'new_value': pn_release_after_cancelling['releases'][0]['tag'][0],
                    'old_value': pn_release_before_cancelling['releases'][0]['tag'][0]
                },
                "root['releases'][0]['tender']['status']": {
                    'new_value': pn_release_after_cancelling['releases'][0]['tender']['status'],
                    'old_value': pn_release_before_cancelling['releases'][0]['tender']['status']
                },
                "root['releases'][0]['tender']['statusDetails']": {
                    'new_value': pn_release_after_cancelling['releases'][0]['tender']['statusDetails'],
                    'old_value': pn_release_before_cancelling['releases'][0]['tender']['statusDetails']
                }
            }
        }

        actual_result = DeepDiff(pn_release_before_cancelling, pn_release_after_cancelling)
        assert compare_actual_result_and_expected_result(
            expected_result=str(expected_result),
            actual_result=str(actual_result)
        )
예제 #2
0
 def test_send_the_request_27594_1(self, country, language, instance, cassandra_username, cassandra_password, pmd):
     pn = PN(
         payload=None,
         lang=language,
         country=country,
         instance=instance,
         cassandra_username=cassandra_username,
         cassandra_password=cassandra_password,
         pmd=pmd
     )
     create_pn_response = pn.insert_pn_obligatory_update()
     cancel_pn_response = pn.cancel_pn(
         cp_id=create_pn_response[4],
         pn_id=create_pn_response[5],
         pn_token=create_pn_response[6]
     )
     assert compare_actual_result_and_expected_result(
         expected_result=str(202),
         actual_result=str(cancel_pn_response.status_code)
     )
예제 #3
0
 def test_send_request_see_result_in_feed_point_27594_2(self, country, language, instance, cassandra_username,
                                                        cassandra_password, pmd):
     pn = PN(
         payload=None,
         lang=language,
         country=country,
         instance=instance,
         cassandra_username=cassandra_username,
         cassandra_password=cassandra_password,
         pmd=pmd
     )
     create_pn_response = pn.insert_pn_obligatory_update()
     pn.cancel_pn(
         cp_id=create_pn_response[4],
         pn_id=create_pn_response[5],
         pn_token=create_pn_response[6]
     )
     pn.check_on_that_message_is_successfully_cancel_pn(cp_id=create_pn_response[5])
     assert compare_actual_result_and_expected_result(
         expected_result=str(True),
         actual_result=str(pn.check_on_that_message_is_successfully_cancel_pn(cp_id=create_pn_response[4]))
     )