test_settings.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import json
  2. from types import SimpleNamespace
  3. import pytest
  4. from mock import patch
  5. from backend.lambdas.settings import handlers
  6. pytestmark = [pytest.mark.unit, pytest.mark.api, pytest.mark.settings]
  7. @patch("backend.lambdas.settings.handlers.get_config")
  8. def test_it_process_queue(mock_config):
  9. mock_config.return_value = {
  10. "AthenaConcurrencyLimit": 15,
  11. "AthenaQueryMaxRetries": 2,
  12. "DeletionTasksMaxNumber": 50,
  13. "QueryExecutionWaitSeconds": 5,
  14. "QueryQueueWaitSeconds": 5,
  15. "ForgetQueueWaitSeconds": 30,
  16. }
  17. response = handlers.list_settings_handler({}, SimpleNamespace())
  18. assert 200 == response["statusCode"]
  19. assert "headers" in response
  20. assert {
  21. "Settings": {
  22. "AthenaConcurrencyLimit": 15,
  23. "AthenaQueryMaxRetries": 2,
  24. "DeletionTasksMaxNumber": 50,
  25. "QueryExecutionWaitSeconds": 5,
  26. "QueryQueueWaitSeconds": 5,
  27. "ForgetQueueWaitSeconds": 30,
  28. }
  29. } == json.loads(response["body"])