def test_save_items(self):
     mock = MagicMock()
     mock.request.return_value = mock
     mock.json.return_value = {Constants.DUMMY: [1], 'total': 50, 'limit': 1}
     requestor = HttpRequestor(client=mock, save_fn=mock)
     result = requestor.save_data_items(Constants.DUMMY)
     self.assertTrue(result)
示例#2
0
def collect_service_endpoint_data(service, endpoint, log=True):
    requestor = HttpRequestor()
    if log:
        print(f'Collecting {service}/{endpoint}...')
    requestor.save_data_items(service, endpoint, False)
示例#3
0
def collect_service_data(service, log=True):
    requestor = HttpRequestor()
    if log:
        print(f'Collecting {service}...')
    requestor.save_data_items(service)