Skip to content

Commit

Permalink
Change is_real to is_healthy_orbit
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfriedman6 committed Apr 4, 2024
1 parent a1d50f8 commit bfccc47
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 2024-03-29 -- v0.0.1
## 2024-04-04 -- v0.0.1
### Added
- Initial commit without any recovery queries
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ docker container run -e ENVIRONMENT=<env> -e AWS_ACCESS_KEY_ID=<> -e AWS_SECRET_
## Git workflow
This repo has only two branches: [`main`](https://github.com/NYPL/location-visits-poller/tree/main), which contains the latest and greatest commits and [`production`](https://github.com/NYPL/location-visits-poller/tree/production), which contains what's in our production environment.

### Ideal Workflow
### Workflow
- Cut a feature branch off of `main`
- Commit changes to your feature branch
- File a pull request against `main` and assign a reviewer
Expand Down
8 changes: 4 additions & 4 deletions lib/shoppertrak_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ def parse_response(self, xml_root, input_date_str, is_recovery_mode=False):
is_healthy_orbit = code == "01"
if code != "01" and code != "02":
self.logger.warning(
f"Unknown code: '{code}'. Setting is_real to False"
f"Unknown code: '{code}'. Setting is_healthy_orbit to "
f"False"
)

if is_healthy_orbit or not is_recovery_mode:
Expand Down Expand Up @@ -138,12 +139,11 @@ def _check_response(self, response_text):
return root

def _get_xml_str(self, xml, attribute):
attribute_str = (xml.get(attribute) or "").strip()
if not attribute_str:
if not xml.get(attribute):
self.logger.warning(f"Found blank '{attribute}'")
return None
else:
return attribute_str
return xml.get(attribute).strip()

def _cast_str_to_int(self, input_str):
if not input_str:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_shoppertrak_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def test_parse_response_new_code(self, test_instance, caplog):
== _PARSED_RESULT
)

assert "Unknown code: '03'. Setting is_real to False" in caplog.text
assert "Unknown code: '03'. Setting is_healthy_orbit to False" in caplog.text

def test_parse_response_blank_str(self, test_instance, caplog):
_MODIFIED_RESPONSE = _TEST_API_RESPONSE.replace('code="02" ', "")
Expand Down

0 comments on commit bfccc47

Please sign in to comment.