Skip to content

Commit b2ec4bc

Browse files
committed
Fix BuildStatus.success property and test it
1 parent cff4082 commit b2ec4bc

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

snapshot_manager/snapshot_manager/build_status.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,29 @@ def render_as_markdown(self) -> str:
115115

116116
@property
117117
def success(self) -> bool:
118-
return self.copr_build_state.success
118+
"""Returns True if the underlying copr build state is "succeeded" or "forked".
119+
120+
Examples:
121+
122+
>>> BuildState(copr_build_state="succeeded").success
123+
True
124+
125+
>>> BuildState(copr_build_state="forked").success
126+
True
127+
128+
>>> BuildState(copr_build_state=CoprBuildStatus.SUCCEEDED).success
129+
True
130+
131+
>>> BuildState(copr_build_state=CoprBuildStatus.FORKED).success
132+
True
133+
134+
>>> BuildState(copr_build_state="waiting").success
135+
False
136+
137+
>>> BuildState(copr_build_state=CoprBuildStatus.IMPORTING).success
138+
False
139+
"""
140+
return CoprBuildStatus(str(self.copr_build_state)).success
119141

120142
@property
121143
def os(self):

0 commit comments

Comments
 (0)