def test_get_sync_logs_call(mock_data): """ get logs from a sync - method call """ bulk = Bulk(test=True) bulk.exports('contacts') bulk.job_sync = SYNC_RESPONSE_SUCCESS mock_data.return_value = RETURN_SYNC_LOGS['items'] bulk.get_sync_logs() mock_data.assert_called_with(endpoint='/syncs/1/logs')
def test_get_sync_logs_rt(mock_data): """ get logs from a sync - return data """ bulk = Bulk(test=True) bulk.exports('contacts') bulk.job_sync = SYNC_RESPONSE_SUCCESS mock_data.return_value = RETURN_SYNC_LOGS['items'] data = bulk.get_sync_logs() assert data == RETURN_SYNC_LOGS['items']
def test_get_sync_logs_notexp(mock_data): """ get logs from a sync - exception """ bulk = Bulk(test=True) bulk.imports('contacts') mock_data.return_value = RETURN_SYNC_LOGS['items'] bulk.get_sync_logs()