Skip to content

Conversation

jophals
Copy link
Contributor

@jophals jophals commented Feb 17, 2025

No description provided.

@jdamerow
Copy link
Member

I get 5 errors when running the tests:

======================================================================
ERROR: test_create_order (track.tests.test_gbf.TestGBF.test_create_order)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/unittest/mock.py", line 1424, in patched
    return func(*newargs, **newkeywargs)
  File "/edrop/track/tests/test_gbf.py", line 100, in test_create_order
    result = gbf.create_order(self.order_object, self.address_data)
  File "/edrop/track/gbf.py", line 39, in create_order
    return _check_order_response(order_response)
  File "/edrop/track/gbf.py", line 109, in _check_order_response
    log_manager.append_to_gbf_log(LogManager.LEVEL_DEBUG, response_body, order_number)
                                                                         ^^^^^^^^^^^^
NameError: name 'order_number' is not defined

======================================================================
ERROR: test_get_order_confirmations_failure (track.tests.test_gbf.TestGBF.test_get_order_confirmations_failure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/unittest/mock.py", line 1424, in patched
    return func(*newargs, **newkeywargs)
  File "/edrop/track/tests/test_gbf.py", line 191, in test_get_order_confirmations_failure
    result = gbf.get_order_confirmations(self.order_numbers)
  File "/edrop/track/gbf.py", line 195, in get_order_confirmations
    if response_body['success'] != True:
       ~~~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'success'

======================================================================
ERROR: test_place_order_with_GBF_failure (track.tests.test_gbf.TestGBF.test_place_order_with_GBF_failure)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/unittest/mock.py", line 1424, in patched
    return func(*newargs, **newkeywargs)
  File "/edrop/track/tests/test_gbf.py", line 155, in test_place_order_with_GBF_failure
    result = gbf._place_order_with_GBF(self.mock_order_json)
TypeError: _place_order_with_GBF() missing 1 required positional argument: 'order_number'

======================================================================
ERROR: test_place_order_with_GBF_success (track.tests.test_gbf.TestGBF.test_place_order_with_GBF_success)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/unittest/mock.py", line 1424, in patched
    return func(*newargs, **newkeywargs)
  File "/edrop/track/tests/test_gbf.py", line 137, in test_place_order_with_GBF_success
    result = gbf._place_order_with_GBF(self.mock_order_json)
TypeError: _place_order_with_GBF() missing 1 required positional argument: 'order_number'

======================================================================
ERROR: test_get_record_info_failure (track.tests.test_redcap.TestRedcapFunctions.test_get_record_info_failure)
Test get_record_info returns None if the response is not HTTP 200.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/unittest/mock.py", line 1424, in patched
    return func(*newargs, **newkeywargs)
  File "/edrop/track/tests/test_redcap.py", line 96, in test_get_record_info_failure
    result = get_record_info(self.record_id)
  File "/edrop/track/redcap.py", line 86, in get_record_info
    raise REDCapError(f"REDCap returned {r.status_code}.")
track.exceptions.REDCapError: REDCap returned 500.

----------------------------------------------------------------------
Ran 20 tests in 0.320s

FAILED (errors=5)

@jdamerow jdamerow closed this Feb 20, 2025
@Girik1105 Girik1105 reopened this Feb 21, 2025
@jdamerow jdamerow merged commit f560983 into develop Feb 25, 2025
2 checks passed
@jdamerow jdamerow deleted the story/gh-25 branch February 25, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants