-
Notifications
You must be signed in to change notification settings - Fork 340
Adding support for TensorFlow 2.x #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
7078cb6
d88a66b
8b5a6b3
7ee369d
d1a9933
68ebe77
5633b9f
d715628
b63a4fe
9892054
f54e634
9a148aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -763,7 +763,12 @@ def teardown_class(cls): | |
testutils.cleanup_apps() | ||
|
||
@staticmethod | ||
def _url(project_id, model_id): | ||
def _update_url(project_id, model_id): | ||
update_url = 'projects/{0}/models/{1}?updateMask=state.published' | ||
return BASE_URL + update_url.format(project_id, model_id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Consider doing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's one character too long. I can wrap it or I can leave it? Which do you prefer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be something like:
|
||
|
||
@staticmethod | ||
def _get_url(project_id, model_id): | ||
return BASE_URL + 'projects/{0}/models/{1}'.format(project_id, model_id) | ||
|
||
@staticmethod | ||
|
@@ -778,10 +783,9 @@ def test_immediate_done(self, publish_function, published): | |
assert model == CREATED_UPDATED_MODEL_1 | ||
assert len(recorder) == 1 | ||
assert recorder[0].method == 'PATCH' | ||
assert recorder[0].url == TestPublishUnpublish._url(PROJECT_ID, MODEL_ID_1) | ||
assert recorder[0].url == TestPublishUnpublish._update_url(PROJECT_ID, MODEL_ID_1) | ||
body = json.loads(recorder[0].body.decode()) | ||
assert body.get('model', {}).get('state', {}).get('published', None) is published | ||
assert body.get('updateMask', {}) == 'state.published' | ||
assert body.get('state', {}).get('published', None) is published | ||
|
||
@pytest.mark.parametrize('publish_function', PUBLISH_UNPUBLISH_FUNCS) | ||
def test_returns_locked(self, publish_function): | ||
|
@@ -794,9 +798,9 @@ def test_returns_locked(self, publish_function): | |
assert model == expected_model | ||
assert len(recorder) == 2 | ||
assert recorder[0].method == 'PATCH' | ||
assert recorder[0].url == TestPublishUnpublish._url(PROJECT_ID, MODEL_ID_1) | ||
assert recorder[0].url == TestPublishUnpublish._update_url(PROJECT_ID, MODEL_ID_1) | ||
assert recorder[1].method == 'GET' | ||
assert recorder[1].url == TestPublishUnpublish._url(PROJECT_ID, MODEL_ID_1) | ||
assert recorder[1].url == TestPublishUnpublish._get_url(PROJECT_ID, MODEL_ID_1) | ||
|
||
@pytest.mark.parametrize('publish_function', PUBLISH_UNPUBLISH_FUNCS) | ||
def test_operation_error(self, publish_function): | ||
|
@@ -973,12 +977,10 @@ def test_list_models_with_all_args(self): | |
page_token=PAGE_TOKEN) | ||
assert len(recorder) == 1 | ||
assert recorder[0].method == 'GET' | ||
assert recorder[0].url == TestListModels._url(PROJECT_ID) | ||
assert json.loads(recorder[0].body.decode()) == { | ||
'list_filter': 'display_name=displayName3', | ||
'page_size': 10, | ||
'page_token': PAGE_TOKEN | ||
} | ||
assert recorder[0].url == ( | ||
TestListModels._url(PROJECT_ID) + | ||
'?filter=display_name%3DdisplayName3&page_size=10&page_token={0}' | ||
.format(PAGE_TOKEN)) | ||
assert isinstance(models_page, mlkit.ListModelsPage) | ||
assert len(models_page.models) == 1 | ||
assert models_page.models[0] == MODEL_3 | ||
|
Uh oh!
There was an error while loading. Please reload this page.