Skip to content

Commit

Permalink
Have tests play nicely with each other
Browse files Browse the repository at this point in the history
  • Loading branch information
schloerke committed Nov 15, 2024
1 parent 9eaf38d commit 8269629
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 6 additions & 6 deletions integration/tests/posit/connect/test_content_item_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ def setup_class(cls):
cls.content = cls.client.content.create(name="example")

cls.user_aron = cls.client.users.create(
username="aron",
email="aron@example.com",
password="s3cur3p@ssword",
username="permission_aron",
email="permission_aron@example.com",
password="permission_s3cur3p@ssword",
)
cls.user_bill = cls.client.users.create(
username="bill",
email="bill@example.com",
password="s3cur3p@ssword",
username="permission_bill",
email="permission_bill@example.com",
password="permission_s3cur3p@ssword",
)

cls.group_friends = cls.client.groups.create(name="Friends")
Expand Down
8 changes: 6 additions & 2 deletions integration/tests/posit/connect/test_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ class TestUser:
@classmethod
def setup_class(cls):
cls.client = client = connect.Client()

# Play nicely with other tests
cls.existing_users = client.users.count()

cls.aron = client.users.create(
username="aron",
email="aron@example.com",
Expand All @@ -29,8 +33,8 @@ def test_lock(self):
assert len(self.client.users.find(account_status="locked")) == 0

def test_count(self):
# aron, bill, cole, and me
assert self.client.users.count() == 4
# aron, bill, cole, and me (and existing user)
assert self.client.users.count() == 3 + self.existing_users

def test_find(self):
assert self.client.users.find(prefix="aron") == [self.aron]
Expand Down

0 comments on commit 8269629

Please sign in to comment.