Skip to content

Commit

Permalink
adding test to None functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Dec 10, 2024
1 parent 139c1a2 commit 1121ab5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import responses

from caveclient.endpoints import annotation_endpoints_v2, schema_endpoints_v2
from responses.matchers import json_params_matcher

from .conftest import datastack_dict, test_info

Expand Down Expand Up @@ -187,3 +188,26 @@ def test_staged_post(self, myclient, mocker):
myclient.annotation.upload_staged_annotations(schema_stage)
schema_stage.table_name = self.default_mapping.get("table_name")
myclient.annotation.upload_staged_annotations(schema_stage)

@responses.activate
def test_update_metadata(self, myclient):
update_table_name = "test_table"
endpoint_mapping = self.default_mapping
endpoint_mapping["table_name"] = update_table_name

post_url = self.ae_endpoints.get("tables").format_map(endpoint_mapping)

metadata = {"description": "a new description", "notice_text": ""}

metadata_match = {"metadata": metadata, "table_name": update_table_name}
responses.add(
responses.PUT,
url=post_url,
json=metadata,
match=[json_params_matcher(metadata_match)],
)

resp = myclient.annotation.update_metadata(
update_table_name, description="a new description", notice_text="None"
)
print(resp)

0 comments on commit 1121ab5

Please sign in to comment.