def test_doi_added_to_payload(self, mocker, app):
     """Test that the DOI is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['doi'] == app.config['DOI']
 def test_endpoint_added_to_payload(self, mocker, app):
     """Test that the endpoint is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['endpoint'] == app.config['ENDPOINT']
 def test_endpoint_added_to_payload(self, mocker, app):
     """Test that the endpoint is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['endpoint'] == app.config['ENDPOINT']
 def test_doi_added_to_payload(self, mocker, app):
     """Test that the DOI is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['doi'] == app.config['DOI']
 def test_throttle_added_to_payload(self, mocker, app):
     """Test that the number of seconds to throttle is added."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     throttle = app.config['THROTTLE']
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['throttle'] == throttle
 def test_api_key_added_to_payload(self, mocker, app):
     """Test that the API key is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     key = 'token'
     mock_request.args = {'api_key': key}
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['api_key'] == key
 def test_mail_recipients_added_to_payload(self, mocker, app):
     """Test that the mail recipients are added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     recipients = app.config['MAIL_RECIPIENTS']
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['mail_recipients'] == recipients
 def test_throttle_added_to_payload(self, mocker, app):
     """Test that the number of seconds to throttle is added."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     throttle = app.config['THROTTLE']
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['throttle'] == throttle
 def test_api_key_added_to_payload(self, mocker, app):
     """Test that the API key is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     key = 'token'
     mock_request.args = {'api_key': key}
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['api_key'] == key
Beispiel #10
0
 def test_mail_recipients_added_to_payload(self, mocker, app):
     """Test that the mail recipients are added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     recipients = app.config['MAIL_RECIPIENTS']
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['mail_recipients'] == recipients
Beispiel #11
0
 def test_path_added_to_payload(self, mocker, app):
     """Test that the analysis path is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     path = '/example'
     mock_request.path = path
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['path'] == path
Beispiel #12
0
 def test_path_added_to_payload(self, mocker, app):
     """Test that the analysis path is added to the payload."""
     mock_request = mocker.patch('libcrowds_analyst.api.request')
     mock_request.args = {'api_key': 'token'}
     path = '/example'
     mock_request.path = path
     mock_request.json = {}
     pl = api.process_payload()
     assert pl['path'] == path