Skip to content

Commit 953792c

Browse files
author
Eero Aaltonen
committed
proposed: rename get_build_runs reply object
1 parent 0e3f447 commit 953792c

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ build_list: BuildListResponse = art.builds.list()
517517
#### Get a list of build runs
518518

519519
```python
520-
build_runs: BuildRun = art.builds.get_build_runs("<build_name>")
520+
build_runs: BuildRuns = art.builds.get_build_runs("<build_name>")
521521
```
522522

523523
#### Get the information about a build

pyartifactory/models/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
BuildPromotionRequest,
2929
BuildPromotionResult,
3030
BuildProperties,
31-
BuildRun,
31+
BuildRuns,
3232
Run,
3333
SimpleBuild,
3434
)
@@ -92,7 +92,7 @@
9292
"SimpleBuild",
9393
"BuildListResponse",
9494
"Run",
95-
"BuildRun",
95+
"BuildRuns",
9696
"BuildArtifact",
9797
"BuildModules",
9898
"BuildAgent",

pyartifactory/models/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Run(BaseModel):
4444
started: str
4545

4646

47-
class BuildRun(BaseModel):
47+
class BuildRuns(BaseModel):
4848
"""Models artifactory build runs."""
4949

5050
uri: str

pyartifactory/objects/build.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
BuildPromotionRequest,
1818
BuildPromotionResult,
1919
BuildProperties,
20-
BuildRun,
20+
BuildRuns,
2121
)
2222
from pyartifactory.objects.object import ArtifactoryObject
2323

@@ -29,11 +29,11 @@ class ArtifactoryBuild(ArtifactoryObject):
2929

3030
_uri = "build"
3131

32-
def get_build_runs(self, build_name: str) -> BuildRun:
32+
def get_build_runs(self, build_name: str) -> BuildRuns:
3333
"""Provides information about the build runs for the given build name.
3434
3535
:param build_name: Build name to be retrieved
36-
:return: BuildRun model object containing server response
36+
:return: BuildRuns model object containing server response
3737
"""
3838
try:
3939
response = self._get(
@@ -44,7 +44,7 @@ def get_build_runs(self, build_name: str) -> BuildRun:
4444
except requests.exceptions.HTTPError as error:
4545
self._raise_exception(error)
4646

47-
return BuildRun(**response.json())
47+
return BuildRuns(**response.json())
4848

4949
def get_build_info(
5050
self,

tests/test_build.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
BuildPromotionRequest,
1919
BuildPromotionResult,
2020
BuildProperties,
21-
BuildRun,
21+
BuildRuns,
2222
Run,
2323
)
2424

2525
URL = "http://localhost:8080/artifactory"
2626
AUTH = ("user", "password_or_apiKey")
2727

28-
BUILD_RUNS = BuildRun(
28+
BUILD_RUNS = BuildRuns(
2929
uri=f"{URL}/api/build/build_name",
3030
buildsNumbers=[
3131
Run(uri="/number", started="2025-09-05T19:55:09.593+0000"),
@@ -66,7 +66,7 @@ def test_get_build_numbers_success(mocker):
6666
mocker.spy(artifactory_build, "get_build_runs")
6767
get_build_runs = artifactory_build.get_build_runs("build_name")
6868

69-
assert isinstance(get_build_runs, BuildRun)
69+
assert isinstance(get_build_runs, BuildRuns)
7070
assert get_build_runs == BUILD_RUNS
7171

7272

0 commit comments

Comments
 (0)