-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it possible for a package to require a compatible version of Par…
…tCAD (#1)
- Loading branch information
Showing
5 changed files
with
49 additions
and
2 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
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,2 @@ | ||
# This configuration file has the version requirements that always fail | ||
partcad: "<0.1.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This configuration file has the version requirements that always pass | ||
partcad: ">=0.1.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# OpenVMP, 2023 | ||
# | ||
# Author: Roman Kuzmenko | ||
# Created: 2023-12-27 | ||
# | ||
# Licensed under Apache License, Version 2.0. | ||
# | ||
|
||
import partcad as pc | ||
|
||
|
||
def test_project_config_version_1(): | ||
"""Positive test case for PartCAD version requirement in the package config file""" | ||
try: | ||
ctx = pc.Context("tests/unit/data/project_config_valid_1.yaml") | ||
assert ctx.config_obj["partcad"] == ">=0.1.0" | ||
except Exception as e: | ||
assert False, "Valid configuration file caused an exception: %s" % e | ||
|
||
|
||
def test_project_config_version_2(): | ||
"""Negative test case for PartCAD version requirement in the package config file""" | ||
try: | ||
ctx = pc.Context("tests/unit/data/project_config_invalid_1.yaml") | ||
assert False, "Invalid configuration file did not cause an exception" | ||
except: | ||
_ignore = True |