Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion clarifai/client/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ def app(self, app_id: str, **kwargs) -> App:
raise Exception(response.status)

kwargs['user_id'] = self.id
return App.from_auth_helper(auth=self.auth_helper, app_id=app_id, **kwargs)
kwargs['app_id'] = app_id
app = App.from_auth_helper(auth=self.auth_helper, **kwargs)
app.app_info.CopyFrom(response.app)
return app

def runner(self, runner_id: str) -> dict:
"""Returns a Runner object if exists.
Expand Down
11 changes: 11 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ def test_patch_app(self, create_client, caplog):
)
assert "SUCCESS" in caplog.text

def test_get_app(self, create_client):
# Verify that user.app() returns actual server data, not empty/default values
app = create_client.app(app_id=CREATE_APP_ID)
# These should match what was set in test_patch_app
assert app.app_info.visibility.gettable == 10, (
f"Expected visibility 10, got {app.app_info.visibility.gettable}"
)
assert app.app_info.description == 'App Patching Test', (
f"Expected description 'App Patching Test', got '{app.app_info.description}'"
)

def test_patch_dataset(self, create_app, caplog):
with caplog.at_level(logging.INFO):
create_app.patch_dataset(
Expand Down