Skip to content

Commit

Permalink
feat: simplifies the overload signatures without breaking forward com…
Browse files Browse the repository at this point in the history
…patibility
  • Loading branch information
tdstein committed Jul 10, 2024
1 parent 1df6ec4 commit 0fb841d
Show file tree
Hide file tree
Showing 4 changed files with 196 additions and 394 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,5 @@ cython_debug/

# Ruff
.ruff_cache/

/.luarc.json
12 changes: 5 additions & 7 deletions integration/tests/posit/connect/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,29 @@
class TestGroups:
def setup_class(cls):
cls.client = connect.Client()
cls.item = cls.client.groups.create("Friends")
cls.item = cls.client.groups.create(name="Friends")

def teardown_class(cls):
cls.item.delete()
assert cls.client.groups.count() == 0

def test_count(self):
assert self.client.groups.count() == 1
assert self.client.groups.count(prefix="f") == 1
assert self.client.groups.count(prefix="miss") == 0

def test_get(self):
assert self.client.groups.get(self.item.guid)

def test_find(self):
assert self.client.groups.find() == [self.item]
assert self.client.groups.find("f") == [self.item]
assert self.client.groups.find(prefix="f") == [self.item]
assert self.client.groups.find(prefix="f", remote=False) == [self.item]
assert self.client.groups.find(prefix="miss") == []

def test_find_one(self):
assert self.client.groups.find_one() == self.item
assert self.client.groups.find_one("f") == self.item
assert self.client.groups.find_one(prefix="f") == self.item
assert (
self.client.groups.find_one(prefix="f", remote=False) == self.item
)
assert self.client.groups.find_one(prefix="miss") is None

def test_remote(self):
with pytest.raises(connect.errors.ClientError):
Expand Down
Loading

0 comments on commit 0fb841d

Please sign in to comment.