Skip to content

Commit c63c341

Browse files
committed
test(fix): destroy the default integration before testing.
1 parent def37c7 commit c63c341

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

integration/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ PYTEST_ARGS ?= "-s"
2626

2727
# Versions
2828
CONNECT_VERSIONS := \
29+
2025.06.0 \
30+
2025.05.0 \
2931
2025.04.0 \
3032
2025.03.0 \
3133
2025.02.0 \

integration/tests/posit/connect/oauth/test_associations.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ class TestAssociations:
1616
@classmethod
1717
def setup_class(cls):
1818
cls.client = connect.Client()
19+
20+
# Destroy existing integrations.
21+
#
22+
# Starting with Connect 2025.05.0, a default integration is created automatically.
23+
# https://github.com/posit-dev/connect/issues/31570
24+
for integration in cls.client.oauth.integrations.find():
25+
integration.delete()
26+
27+
# Assert that no integrations exist
28+
assert len(cls.client.oauth.integrations.find()) == 0
29+
1930
cls.integration = cls.client.oauth.integrations.create(
2031
name="example integration",
2132
description="integration description",
@@ -49,10 +60,12 @@ def setup_class(cls):
4960
# create content
5061
# requires full bundle deployment to produce an interactive content type
5162
cls.content = cls.client.content.create(name="example-flask-minimal")
63+
5264
# create bundle
5365
path = Path("../../../../resources/connect/bundles/example-flask-minimal/bundle.tar.gz")
5466
path = (Path(__file__).parent / path).resolve()
5567
bundle = cls.content.bundles.create(str(path))
68+
5669
# deploy bundle
5770
task = bundle.deploy()
5871
task.wait_for()
@@ -61,11 +74,17 @@ def setup_class(cls):
6174

6275
@classmethod
6376
def teardown_class(cls):
77+
# Destroy created integrations.
6478
cls.integration.delete()
6579
cls.another_integration.delete()
80+
81+
# Assert that no integrations exist
6682
assert len(cls.client.oauth.integrations.find()) == 0
6783

84+
# Destroy created content
6885
cls.content.delete()
86+
87+
# Assert that no content exists
6988
assert cls.client.content.count() == 0
7089

7190
def test_find_by_integration(self):

integration/tests/posit/connect/test_groups.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ class TestGroups:
55
@classmethod
66
def setup_class(cls):
77
cls.client = connect.Client()
8-
cls.item = cls.client.groups.create(name="Friends")
8+
cls.group = cls.client.groups.create(name="Friends")
99

1010
@classmethod
1111
def teardown_class(cls):
12-
cls.item.delete()
12+
cls.group.delete()
1313
assert cls.client.groups.count() == 0
1414

1515
def test_count(self):
1616
assert self.client.groups.count() == 1
1717

1818
def test_get(self):
19-
assert self.client.groups.get(self.item["guid"])
19+
assert self.client.groups.get(self.group["guid"])
2020

2121
def test_find(self):
22-
assert self.client.groups.find() == [self.item]
22+
assert self.client.groups.find() == [self.group]
2323

2424
def test_find_one(self):
25-
assert self.client.groups.find_one() == self.item
25+
assert self.client.groups.find_one() == self.group

0 commit comments

Comments
 (0)