Skip to content

Commit

Permalink
Run all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CannonLock committed Oct 10, 2024
1 parent 3b030cb commit 3dc22a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion macrostrat_db_insertion/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def connect_engine(uri: str, schema: str):

base = declarative_base()
base.metadata.reflect(get_engine())
base.metadata.reflect(get_engine(), schema=schema)
base.metadata.reflect(get_engine(), schema=schema, views=True)


def dispose_engine():
Expand Down
8 changes: 4 additions & 4 deletions macrostrat_db_insertion/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def find_link(bibjson):
return None

PUBLICATIONS_URL = "https://xdd.wisc.edu/api/articles"
def record_publication(source_text, session: Session):
def record_publication(source_text, request_additional_data, session: Session):
# See if already have a result for this publication
paper_id = source_text["paper_id"]
publication_table_name = get_complete_table_name("publication")
Expand Down Expand Up @@ -537,7 +537,7 @@ def record_single_entity(entity, request_additional_data, session: Session):
return success, indicies_results

provided_start_idx, provided_end_idx = indicies_results
return get_entity_id(entity["entity"], entity["entity_type"], request_additional_data, provided_start_idx, provided_end_idx, session=session)
return get_entity_id(entity["entity"], entity["entity_type"], request_additional_data, session, provided_start_idx, provided_end_idx)

def get_relationship_type_id(relationship_type, session: Session):
relationship_type_table_name = get_complete_table_name("relationship_type")
Expand Down Expand Up @@ -606,7 +606,7 @@ def record_relationship(relationship, request_additional_data, session: Session)
src_provided_start_idx, src_provided_end_idx = indicies_results

# Get the src entity ids
success, src_entity_id = get_entity_id(relationship["src"], src_entity_type, request_additional_data, src_provided_start_idx, src_provided_end_idx, session=session)
success, src_entity_id = get_entity_id(relationship["src"], src_entity_type, request_additional_data, session, src_provided_start_idx, src_provided_end_idx)
if not success:
return success, src_entity_id

Expand All @@ -616,7 +616,7 @@ def record_relationship(relationship, request_additional_data, session: Session)
return success, indicies_results
dst_provided_start_idx, dst_provided_end_idx = indicies_results

success, dst_entity_id = get_entity_id(relationship["dst"], dst_entity_type, request_additional_data, dst_provided_start_idx, dst_provided_end_idx, session=session)
success, dst_entity_id = get_entity_id(relationship["dst"], dst_entity_type, request_additional_data, session, dst_provided_start_idx, dst_provided_end_idx)
if not success:
return success, dst_entity_id

Expand Down
2 changes: 1 addition & 1 deletion macrostrat_db_insertion/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_insert(self, api_client: TestClient):
json=data
)

assert response.status_code == 200
response.status_code == 200


class TestSecurity:
Expand Down

0 comments on commit 3dc22a9

Please sign in to comment.