-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into schloerke/324-merge-api-and-resource
- Loading branch information
Showing
29 changed files
with
440 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ jobs: | |
matrix: | ||
CONNECT_VERSION: | ||
- preview | ||
- 2024.09.0 | ||
- 2024.08.0 | ||
- 2024.06.0 | ||
- 2024.05.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from packaging import version | ||
from packaging.version import parse | ||
|
||
from posit import connect | ||
|
||
client = connect.Client() | ||
client_version = client.version | ||
assert client_version is not None | ||
CONNECT_VERSION = version.parse(client_version) | ||
version = client.version | ||
assert version | ||
CONNECT_VERSION = parse(version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from pathlib import Path | ||
|
||
import pytest | ||
from packaging import version | ||
|
||
from posit import connect | ||
|
||
from . import CONNECT_VERSION | ||
|
||
|
||
@pytest.mark.skipif( | ||
CONNECT_VERSION < version.parse("2024.10.0-dev"), | ||
reason="Packages API unavailable", | ||
) | ||
class TestPackages: | ||
@classmethod | ||
def setup_class(cls): | ||
cls.client = connect.Client() | ||
cls.content = cls.client.content.create(name=cls.__name__) | ||
path = Path("../../../resources/connect/bundles/example-flask-minimal/bundle.tar.gz") | ||
path = (Path(__file__).parent / path).resolve() | ||
bundle = cls.content.bundles.create(str(path)) | ||
task = bundle.deploy() | ||
task.wait_for() | ||
|
||
@classmethod | ||
def teardown_class(cls): | ||
cls.content.delete() | ||
|
||
def test(self): | ||
assert self.client.packages | ||
assert self.content.packages | ||
|
||
def test_find_by(self): | ||
package = self.client.packages.find_by(name="flask") | ||
assert package | ||
assert package["name"] == "flask" | ||
|
||
package = self.content.packages.find_by(name="flask") | ||
assert package | ||
assert package["name"] == "flask" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.