Skip to content
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

refactor: Use new duck typing for content item .repository methods #366

Merged
merged 14 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
from packaging import version

from posit import connect
from posit.connect.content import ContentItem, ContentItemRepository
from posit.connect._repository import ContentItemRepository
from posit.connect.content import ContentItem
from posit.connect.resources import _Resource

from . import CONNECT_VERSION

Expand Down Expand Up @@ -65,7 +67,7 @@ def test_create_get_update_delete(self):
assert content_repo is not None

def assert_repo(r: ContentItemRepository):
assert isinstance(content_repo, ContentItemRepository)
assert isinstance(content_repo, _Resource)
schloerke marked this conversation as resolved.
Show resolved Hide resolved
assert r["repository"] == self.repo_repository
assert r["branch"] == self.repo_branch
assert r["directory"] == self.repo_directory
Expand All @@ -76,12 +78,12 @@ def assert_repo(r: ContentItemRepository):

# Update
ex_branch = "main"
updated_repo = content_repo.update(branch=ex_branch)
assert updated_repo["branch"] == ex_branch
content_repo.update(branch=ex_branch)
assert content_repo["branch"] == ex_branch

assert updated_repo["repository"] == self.repo_repository
assert updated_repo["directory"] == self.repo_directory
assert updated_repo["polling"] is self.repo_polling
assert content_repo["repository"] == self.repo_repository
assert content_repo["directory"] == self.repo_directory
assert content_repo["polling"] is self.repo_polling

# Delete
content_repo.destroy()
Expand Down
142 changes: 0 additions & 142 deletions src/posit/connect/_api.py

This file was deleted.

72 changes: 0 additions & 72 deletions src/posit/connect/_api_call.py

This file was deleted.

37 changes: 0 additions & 37 deletions src/posit/connect/_json.py

This file was deleted.

Loading
Loading