Skip to content

Commit

Permalink
Added test for empty sim
Browse files Browse the repository at this point in the history
  • Loading branch information
rlb131 committed Jul 13, 2023
1 parent a96add3 commit 8ee173f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sirepo_bluesky/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ def make_dirs():
_ = make_dir_tree(datetime.datetime.now().year, base_path=root_dir)


@pytest.fixture(scope="function")
def srw_empty_simulation(make_dirs):
connection = SirepoBluesky("http://localhost:8000")
data, _ = connection.auth("srw", "emptysim")
return connection


@pytest.fixture(scope="function")
def srw_youngs_double_slit_simulation(make_dirs):
connection = SirepoBluesky("http://localhost:8000")
Expand Down
8 changes: 8 additions & 0 deletions sirepo_bluesky/tests/test_bl_elements_as_ophyd_objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ def test_beamline_elements_as_ophyd_objects(srw_tes_simulation):
pprint.pprint(mono_crystal1.read()) # noqa


def test_empty_simulation(srw_empty_simulation):
classes, objects = create_classes(srw_empty_simulation.data, connection=srw_empty_simulation)
globals().update(**objects)

assert not srw_empty_simulation.data["models"]["beamline"]
assert not objects


@pytest.mark.parametrize("method", ["set", "put"])
def test_beamline_elements_set_put(srw_tes_simulation, method):
classes, objects = create_classes(srw_tes_simulation.data, connection=srw_tes_simulation)
Expand Down

0 comments on commit 8ee173f

Please sign in to comment.