diff --git a/pharus/interface.py b/pharus/interface.py index 3fa3da3..c3d1c14 100644 --- a/pharus/interface.py +++ b/pharus/interface.py @@ -176,15 +176,11 @@ def _fetch_records( # Loop through each attributes, append to the tuple_to_return with specific # modification based on data type for attribute_name, attribute_info in attributes.items(): - if attribute_info.is_external: - # Attribute is external type (filepath or attach), - # thus fill it in string instead - ( - row.append(non_blobs_row[attribute_name]) - if fetch_blobs - else row.append("=FILE=") - ) - elif not attribute_info.is_blob: + if not ( + attribute_info.is_blob + or attribute_info.is_attachment + or attribute_info.is_filepath + ): if non_blobs_row[attribute_name] is None: # If it is none then just append None row.append(None) diff --git a/tests/test_attributes.py b/tests/test_attributes.py index b13685a..d85ec83 100644 --- a/tests/test_attributes.py +++ b/tests/test_attributes.py @@ -45,10 +45,16 @@ def validate(table, inserted_value, expected_type, expected_value, client, token ), ) assert REST_response.status_code == 200 - REST_records = client.get( + resp = client.get( f"/schema/{table.database}/table/{table.__name__}/record", headers=dict(Authorization=f"Bearer {token}"), - ).json["records"] + ) + assert resp.status_code == 200, f"Failed to get records: {resp.text=}" + assert ( + resp.json is not None + ), f"resp.json is None: {resp=} {dir(resp)=} {resp.text=}" + assert "records" in resp.json, f"No records in response: {resp.json=}" + REST_records = resp.json["records"] assert len(REST_records) == 1 assert ( isinstance(REST_records[0][1], expected_type)