Skip to content

Commit

Permalink
Add default_value case
Browse files Browse the repository at this point in the history
  • Loading branch information
Delaunay committed Mar 17, 2022
1 parent 442c95e commit 061708d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/unittests/algo/test_configspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def test_orion_configspace():
space.register(Integer("r1i", "reciprocal", 1, 6))
space.register(Integer("u1i", "uniform", -3, 6))
space.register(Integer("u2i", "uniform", -3, 6))
space.register(Integer("u3i", "uniform", -3, 6, default_value=2))

space.register(Real("r1f", "reciprocal", 1, 6))
space.register(Real("u1f", "uniform", -3, 6))
Expand All @@ -34,6 +35,10 @@ def test_orion_configspace():

converted = roundtrip[k]

converted._default_value = None
# Orion space did not have default values
# but ConfigSpace always set them
if not original.default_value:
converted._default_value = None

assert type(original) == type(converted)
assert original == converted

0 comments on commit 061708d

Please sign in to comment.