Skip to content

Commit

Permalink
Rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jul 22, 2021
1 parent a6ca497 commit 5e6a9a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dandi/dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def create_dandiset(self, name: str, metadata: Dict[str, Any]) -> "RemoteDandise
self, self.post("/dandisets/", json={"name": name, "metadata": metadata})
)

def match_schema_version(self, schema_version: Optional[str] = None) -> None:
def check_schema_version(self, schema_version: Optional[str] = None) -> None:
if schema_version is None:
schema_version = get_schema_version()
server_info = self.get("/info/")
Expand Down
8 changes: 4 additions & 4 deletions dandi/tests/test_dandiapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,24 @@ def test_remote_asset_json_dict(text_dandiset):


@responses.activate
def test_match_schema_version_matches_default():
def test_check_schema_version_matches_default():
responses.add(
responses.GET,
"https://test.nil/api/info/",
json={"schema_version": get_schema_version()},
)
client = DandiAPIClient("https://test.nil/api")
client.match_schema_version()
client.check_schema_version()


@responses.activate
def test_match_schema_version_mismatch():
def test_check_schema_version_mismatch():
responses.add(
responses.GET, "https://test.nil/api/info/", json={"schema_version": "4.5.6"}
)
client = DandiAPIClient("https://test.nil/api")
with pytest.raises(SchemaVersionError) as excinfo:
client.match_schema_version("1.2.3")
client.check_schema_version("1.2.3")
assert (
str(excinfo.value)
== "Server requires schema version 4.5.6; client only supports 1.2.3. "
Expand Down
2 changes: 1 addition & 1 deletion dandi/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def upload(
api_url = instance.api

client = DandiAPIClient(api_url)
client.match_schema_version()
client.check_schema_version()
client.dandi_authenticate()

dandiset = APIDandiset(dandiset.path) # "cast" to a new API based dandiset
Expand Down

0 comments on commit 5e6a9a1

Please sign in to comment.