Skip to content

Commit

Permalink
Add tests for missing_variant_package
Browse files Browse the repository at this point in the history
  • Loading branch information
dgovil committed Oct 20, 2023
1 parent 43b27be commit c218686
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name = "missing_variant_package"
version = "1"

def commands():
pass

variants = [
["noexist"],
["nada"]
]
8 changes: 8 additions & 0 deletions src/rez/tests/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""
from __future__ import print_function

import rez.exceptions
from rez.vendor.version.requirement import Requirement
from rez.solver import Solver, Cycle, SolverStatus
from rez.config import config
Expand Down Expand Up @@ -248,6 +249,13 @@ def test_11_variant_splitting(self):
"test_variant_split_mid2-2.0[0]",
"test_variant_split_start-1.0[1]"])

def test_12_missing_variant_package(self):
config.override("error_on_missing_variant_packages", True)
with self.assertRaises(rez.exceptions.PackageFamilyNotFoundError):
self._solve(["missing_variant_package"], [])

config.override("error_on_missing_variant_packages", False)
self._solve(["missing_variant_package"], ["nada[]", "missing_variant_package-1[1]"])

if __name__ == '__main__':
unittest.main()

0 comments on commit c218686

Please sign in to comment.