Ejemplo n.º 1
0
    def test_get_callback(self, request_mock):
        resources = [{
            "name": "test1",
            "value": "test_value"
        }, {
            "name": "test2",
            "value": "test_value"
        }]

        suffix = local_session(Session).get_subscription_id()[-12:]
        data = {
            "resource-group": "test_logic-app",
            "logic-app-name": "cclogicapp{0}".format(suffix)
        }

        la = LogicAppAction(data=data, manager=self._get_manager())
        la.process(resources)
        req1 = request_mock.call_args_list[0][1]
        req2 = request_mock.call_args_list[1][1]

        regex = r'https://.*/workflows/.*/triggers/manual/paths/invoke' \
                + r'\?api-version=.*triggers%2Fmanual%2Frun'

        self.assertTrue(re.search(regex, req1['url']))
        self.assertTrue(re.search(regex, req2['url']))
Ejemplo n.º 2
0
    def test_get_callback(self, request_mock):
        resources = [{
            "name": "test1",
            "value": "test_value"
        }, {
            "name": "test2",
            "value": "test_value"
        }]

        data = {
            "resource-group": "test_logic-app",
            "logic-app-name": "cclogicapp"
        }

        la = LogicAppAction(data=data, manager=self._get_manager())
        la.process(resources)
        req1 = request_mock.call_args_list[0][1]
        req2 = request_mock.call_args_list[1][1]

        regex = r'https://.*/workflows/.*/triggers/manual/paths/invoke' \
                + r'\?api-version=.*triggers%2Fmanual%2Frun'

        self.assertRegex(req1['url'], regex)
        self.assertRegex(req2['url'], regex)