Skip to content

Commit

Permalink
Add tests for badger and xopt id verification in routine
Browse files Browse the repository at this point in the history
  • Loading branch information
zhe-slac committed Oct 21, 2024
1 parent 7fe38ff commit 4ecec63
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/badger/tests/test_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,8 @@ def test_load_routine(self):
assert new_routine.generator == routine.generator
assert new_routine.vocs == routine.vocs

# Test if xopt and badger version are defined in the routine
assert hasattr(new_routine, 'xopt_version')
assert hasattr(new_routine, 'badger_version')

remove_routine("test")
4 changes: 4 additions & 0 deletions src/badger/tests/test_routine_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ def test_routine_generation(qtbot):
assert routine.vocs.objectives == {"f": "MINIMIZE"}
assert routine.initial_points.empty

# test if badger and xopt version are embedded
assert routine.badger_version is not None
assert routine.xopt_version is not None


def test_add_additional_vars(qtbot):
from badger.db import load_routine, remove_routine
Expand Down

0 comments on commit 4ecec63

Please sign in to comment.