Skip to content

Commit

Permalink
a little more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bpkroth committed Oct 4, 2024
1 parent 5c961d8 commit 7086021
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mlos_bench/mlos_bench/tests/tunables/tunables_assign_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ def test_tunables_assign_defaults(tunable_groups: TunableGroups) -> None:
tunable_groups.assign({}).reset()
assert tunable_groups_defaults == tunable_groups
assert tunable_groups.is_defaults()
tunable_groups.assign({"vmSize": "Standard_B2s"}).reset()
new_vm_size = "Standard_B2s"
assert tunable_groups["vmSize"] != new_vm_size
# Change one value.
tunable_groups.assign({"vmSize": new_vm_size}).reset()
assert tunable_groups["vmSize"] == new_vm_size
# Check that the other values are still defaults.
idle_tunable, _ = tunable_groups.get_tunable("idle")
assert idle_tunable.is_default()
assert tunable_groups_defaults != tunable_groups
assert not tunable_groups.is_defaults()
# Reassign defaults.
tunable_groups.assign({}).reset()
assert tunable_groups["vmSize"] != "Standard_B2s"
assert tunable_groups["vmSize"] != new_vm_size
assert tunable_groups.is_defaults()
assert tunable_groups_defaults == tunable_groups

Expand Down

0 comments on commit 7086021

Please sign in to comment.