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

fix: content overload signatures #290

Merged
merged 3 commits into from
Sep 13, 2024
Merged
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
10 changes: 6 additions & 4 deletions integration/tests/posit/connect/test_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestContent:
@classmethod
def setup_class(cls):
cls.client = connect.Client()
cls.content = cls.client.content.create(name="example")
cls.content = cls.client.content.create()

@classmethod
def teardown_class(cls):
Expand All @@ -23,7 +23,7 @@ def test_count(self):
assert self.client.content.count() == 1

def test_get(self):
assert self.client.content.get(self.content.guid) == self.content
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reaching the edge of my python knowledge here so maybe this is a dumb question but is .guid now a deprecated syntax and did that happen in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's self-imposed. See #262

We are moving away from attribute-based access for object data.

assert self.client.content.get(self.content["guid"]) == self.content

def test_find(self):
assert self.client.content.find()
Expand All @@ -33,13 +33,15 @@ def test_find_one(self):

def test_content_item_owner(self):
item = self.client.content.find_one(include=None)
assert item
owner = item.owner
assert owner.guid == self.client.me.guid
assert owner["guid"] == self.client.me["guid"]

def test_content_item_owner_from_include(self):
item = self.client.content.find_one(include="owner")
assert item
owner = item.owner
assert owner.guid == self.client.me.guid
assert owner["guid"] == self.client.me["guid"]

@pytest.mark.skipif(
CONNECT_VERSION <= version.parse("2024.04.1"),
Expand Down
Loading