-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' for release 0.1.7
Signed-off-by: mimir-d <[email protected]>
- Loading branch information
Showing
10 changed files
with
27 additions
and
9 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
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 |
---|---|---|
|
@@ -78,17 +78,24 @@ The specification does not impose any particular level of usage. To be compliant | |
A very simple starter example, which just outputs a diagnosis: | ||
```py | ||
import ocptv.output as tv | ||
import random | ||
def get_fan_speed(): | ||
return random.randrange(1500, 1700) | ||
def main(): | ||
run = tv.TestRun(name="simple_diagnosis", version="1.0") | ||
dut = tv.Dut(id="server0", name="server0.domain.net") | ||
with run.scope(dut=dut): | ||
step = run.add_step("check_fanspeed") | ||
with step.scope(): | ||
if get_fan_speed() > 1600: # assuming external get_fan_speed() impl | ||
step.add_diagnosis(DiagnosisType.PASS, verdict="fan_ok") | ||
if get_fan_speed() >= 1600: | ||
step.add_diagnosis(tv.DiagnosisType.PASS, verdict="fan_ok") | ||
else: | ||
step.add_diagnosis(DiagnosisType.FAIL, verdict="fan_low") | ||
step.add_diagnosis(tv.DiagnosisType.FAIL, verdict="fan_low") | ||
if __name__ == '__main__': | ||
main() | ||
``` | ||
Expected output (slightly reformatted for readability): | ||
|
@@ -190,4 +197,4 @@ An email contact is also available at: [email protected] | |
<!-- | ||
due to https://github.com/pypa/readme_renderer/issues/163 we must use absolute links everywhere | ||
--> | ||
--> |
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" | |
|
||
[project] | ||
name = "ocptv" | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
description = "OCP Test & Validation project api" | ||
readme = "README.md" | ||
authors = [{ name = "OCP Test & Validation", email = "[email protected]" }] | ||
|
@@ -33,7 +33,7 @@ dev = ["black", "bumpver", "isort", "pip-tools", "pytest", "pytest-cov", "mypy"] | |
"Source" = "https://github.com/opencomputeproject/ocp-diag-python" | ||
|
||
[tool.bumpver] | ||
current_version = "0.1.6" | ||
current_version = "0.1.7" | ||
version_pattern = "MAJOR.MINOR.PATCH" | ||
commit_message = "bump version {old_version} -> {new_version}" | ||
commit = true | ||
|
@@ -61,6 +61,10 @@ profile = "black" | |
|
||
[tool.poetry] | ||
name = "ocptv" | ||
version = "0.1.6" | ||
version = "0.1.7" | ||
description = "OCP Test & Validation project api" | ||
authors = ["OCP Test & Validation <[email protected]>"] | ||
|
||
[tool.setuptools.package-data] | ||
"*" = ["py.typed"] | ||
|
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,5 +1,6 @@ | ||
""" | ||
The OCP Test & Validation python api for the output of spec compliant JSON. | ||
""" | ||
__version__ = "0.1.6" | ||
|
||
__version__ = "0.1.7" | ||
__author__ = "OCP Test & Validation" |
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
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 @@ | ||
# Marker file for PEP 561. This package uses inline types. |