示例#1
0
    def test_sanity(mocker):
        """
        Given
            a limit above the number of available indicators
        When
            calling the get_indicator command
        Then
            verify that the maximum available amount is returned.
        """
        mocker.patch.object(Client,
                            'http_request',
                            side_effect=[
                                {
                                    'objects': INDICATOR * 50
                                },
                                {
                                    'objects': []
                                },
                            ])
        client = Client(
            base_url='',
            user_name='',
            api_key='',
            verify=False,
            proxy=False,
            reliability='B - Usually reliable',
            should_create_relationships=False,
        )

        results = get_indicators(client, limit='7000')

        assert len(results.outputs) == 50
示例#2
0
def mock_client():
    return Client(base_url='',
                  user_name='',
                  api_key='',
                  proxy=False,
                  should_create_relationships=True,
                  verify=False,
                  reliability='B - Usually reliable')