Beispiel #1
0
    def test_invoke(self):
        waiter = mock.Mock()
        waiter_name = "my_waiter"
        session = mock.Mock()
        session.create_client.return_value.get_waiter.return_value = waiter

        parameters = {"Foo": "bar", "Baz": "biz"}
        parsed_globals = mock.Mock()
        parsed_globals.region = "us-east-1"
        parsed_globals.endpoint_url = "myurl"
        parsed_globals.verify_ssl = True

        waiter_caller = WaiterCaller(session, waiter_name)
        waiter_caller.invoke("myservice", "MyWaiter", parameters, parsed_globals)

        # Make sure the client was created properly.
        session.create_client.assert_called_with(
            "myservice",
            region_name=parsed_globals.region,
            endpoint_url=parsed_globals.endpoint_url,
            verify=parsed_globals.verify_ssl,
        )

        # Make sure we got the correct waiter.
        session.create_client.return_value.get_waiter.assert_called_with(waiter_name)

        # Ensure the wait command was called properly.
        waiter.wait.assert_called_with(Foo="bar", Baz="biz")
Beispiel #2
0
    def test_invoke(self):
        waiter = mock.Mock()
        waiter_name = 'my_waiter'
        session = mock.Mock()
        session.create_client.return_value.get_waiter.return_value = waiter

        parameters = {'Foo': 'bar', 'Baz': 'biz'}
        parsed_globals = mock.Mock()
        parsed_globals.region = 'us-east-1'
        parsed_globals.endpoint_url = 'myurl'
        parsed_globals.verify_ssl = True

        waiter_caller = WaiterCaller(session, waiter_name)
        waiter_caller.invoke('myservice', 'MyWaiter', parameters,
                             parsed_globals)

        # Make sure the client was created properly.
        session.create_client.assert_called_with(
            'myservice',
            region_name=parsed_globals.region,
            endpoint_url=parsed_globals.endpoint_url,
            verify=parsed_globals.verify_ssl
        )

        # Make sure we got the correct waiter.
        session.create_client.return_value.get_waiter.assert_called_with(
            waiter_name)

        # Ensure the wait command was called properly.
        waiter.wait.assert_called_with(
            Foo='bar', Baz='biz')
Beispiel #3
0
    def test_invoke(self):
        waiter = mock.Mock()
        waiter_name = 'my_waiter'
        session = mock.Mock()
        session.create_client.return_value.get_waiter.return_value = waiter

        parameters = {'Foo': 'bar', 'Baz': 'biz'}
        parsed_globals = mock.Mock()
        parsed_globals.region = 'us-east-1'
        parsed_globals.endpoint_url = 'myurl'
        parsed_globals.verify_ssl = True

        waiter_caller = WaiterCaller(session, waiter_name)
        waiter_caller.invoke('myservice', 'MyWaiter', parameters,
                             parsed_globals)

        # Make sure the client was created properly.
        session.create_client.assert_called_with(
            'myservice',
            region_name=parsed_globals.region,
            endpoint_url=parsed_globals.endpoint_url,
            verify=parsed_globals.verify_ssl
        )

        # Make sure we got the correct waiter.
        session.create_client.return_value.get_waiter.assert_called_with(
            waiter_name)

        # Ensure the wait command was called properly.
        waiter.wait.assert_called_with(
            Foo='bar', Baz='biz')
Beispiel #4
0
    def test_invoke(self):
        waiter = mock.Mock()
        waiter_name = 'my_waiter'
        operation_object = mock.Mock()
        operation_object.service.get_waiter.return_value = waiter

        parameters = {'Foo': 'bar', 'Baz': 'biz'}
        parsed_globals = mock.Mock()
        parsed_globals.region = 'us-east-1'
        parsed_globals.endpoint_url = 'myurl'
        parsed_globals.verify_ssl = True

        waiter_caller = WaiterCaller(waiter_name)
        waiter_caller.invoke(operation_object, parameters, parsed_globals)
        # Make sure the endpoint was created properly
        operation_object.service.get_endpoint.assert_called_with(
            region_name=parsed_globals.region,
            endpoint_url=parsed_globals.endpoint_url,
            verify=parsed_globals.verify_ssl)

        # Ensure the wait command was called properly.
        waiter.wait.assert_called_with(Foo='bar', Baz='biz')
Beispiel #5
0
    def test_invoke(self):
        waiter = mock.Mock()
        waiter_name = 'my_waiter'
        operation_object = mock.Mock()
        operation_object.service.get_waiter.return_value = waiter

        parameters = {'Foo': 'bar', 'Baz': 'biz'}
        parsed_globals = mock.Mock()
        parsed_globals.region = 'us-east-1'
        parsed_globals.endpoint_url = 'myurl'
        parsed_globals.verify_ssl = True

        waiter_caller = WaiterCaller(waiter_name)
        waiter_caller.invoke(operation_object, parameters, parsed_globals)
        # Make sure the endpoint was created properly
        operation_object.service.get_endpoint.assert_called_with(
            region_name=parsed_globals.region,
            endpoint_url=parsed_globals.endpoint_url,
            verify=parsed_globals.verify_ssl
        )

        # Ensure the wait command was called properly.
        waiter.wait.assert_called_with(
            Foo='bar', Baz='biz')