nomad_camels.tests package

Submodules

nomad_camels.tests.api_test module

nomad_camels.tests.api_test.client_and_thread()
nomad_camels.tests.api_test.is_port_available(port)
nomad_camels.tests.api_test.mock_validate_credentials(credentials: HTTPBasicCredentials = Depends(HTTPBasic))
nomad_camels.tests.api_test.test_favicon(client_and_thread)
nomad_camels.tests.api_test.test_get_protocols(client_and_thread)
nomad_camels.tests.api_test.test_invalid_api_key(client_and_thread)
nomad_camels.tests.api_test.test_root_redirect(client_and_thread)
nomad_camels.tests.api_test.test_run_protocol(client_and_thread)

nomad_camels.tests.instrument_management_test module

nomad_camels.tests.instrument_management_test.install_demo(qtbot, installer)

A helper function, used by test_install_demo_instrument and also by test_add_device, if the device is not yet installed

nomad_camels.tests.instrument_management_test.test_add_device(qtbot)

Going through the instrument management, if demo_instrument is not installed, it will be. Then the config widget is used to add a demo_instrument. In the end there is a check whether it is in the list of devices.

nomad_camels.tests.instrument_management_test.test_install_demo_instrument(qtbot)

This test tries to install the demo device, using the instrument_installer widget.

nomad_camels.tests.mainapp_test module

nomad_camels.tests.mainapp_test.app(qtbot)

Fixture for initializing the application and the MainWindow.

nomad_camels.tests.mainapp_test.test_check_password_protection(app, qtbot)

Test checking password protection.

nomad_camels.tests.mainapp_test.test_set_sample(app)

Test setting the sample.

nomad_camels.tests.mainapp_test.test_set_user(app)

Test setting the user.

nomad_camels.tests.mainapp_test.test_show_hide_log(app, qtbot)

Test showing and hiding the log.

nomad_camels.tests.mainapp_test.test_signal_slots(app, qtbot)

Test to verify that signal-slot connections are properly set.

nomad_camels.tests.mainapp_test.test_ui_initialization(app)

Test to check if UI components are initialized correctly.

nomad_camels.tests.protocol_test module

nomad_camels.tests.protocol_test.catalog_maker(tmp_path)
Parameters:

tmp_path

nomad_camels.tests.protocol_test.ensure_demo_in_devices()
nomad_camels.tests.protocol_test.get_action_from_name(actions, name)
Parameters:
  • actions

  • name

nomad_camels.tests.protocol_test.get_row_from_channel_table(name, table)
Parameters:
  • name

  • table

nomad_camels.tests.protocol_test.mock_message_box(monkeypatch)

If a messagebox, e.g. asking whether to discard all changes to the protocol, pops up, it is automatically accepted

nomad_camels.tests.protocol_test.run_test_protocol(tmp_path, protocol)
Parameters:
  • tmp_path

  • protocol

nomad_camels.tests.protocol_test.select_step_by_name(conf, name)
Parameters:
  • conf

  • name

nomad_camels.tests.protocol_test.single_variable_if(qtbot, conf, wait_in=1, n_prompt=0, n_if=0, len_prot=0)
Parameters:
  • qtbot

  • conf

  • wait_in – (Default value = 1)

  • n_prompt – (Default value = 0)

  • n_if – (Default value = 0)

  • len_prot – (Default value = 0)

nomad_camels.tests.protocol_test.test_change_dev_config(qtbot, tmp_path)

Opens the config for “change device config” tries to configure it for the demo instrument and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_for_loop(qtbot, tmp_path)

Opens the config for a “For Loop” tries to configure it looping over a wait-step and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_gradient_descent(qtbot, tmp_path)

Opens the config for “Gradient Descent” tries to configure it for the demo instrument and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_if_and_set_variables(qtbot, tmp_path)

Opens the config for “If” tries to configure to run the correct way if the variables have the correct value, which is done by a “Set Variables” step.

nomad_camels.tests.protocol_test.test_nd_sweep()
nomad_camels.tests.protocol_test.test_read_channels(qtbot, tmp_path)

Opens the config for “Read Channels” tries to configure it for the demo instrument and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_run_subprotocol()
nomad_camels.tests.protocol_test.test_set_channels(qtbot, tmp_path)

Opens the config for “Set Channels” tries to configure it for the demo instrument and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_simple_sweep_with_plot_and_fit(qtbot, tmp_path)

Opens the config for “Simple Sweep” tries to configure it for the demo instrument. Further it adds a plot and a fit to the sweep and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_trigger_and_read_channels(qtbot, tmp_path)

Opens the config for “Read Channels” tries to configure it with a split triggering of the channels, then configures the trigger-step and tries to run a protocol with these steps.

nomad_camels.tests.protocol_test.test_wait(qtbot, tmp_path)

Opens the config for “Wait” tries to configure it to a wait time of 1.0 second and tries to run a protocol with this step.

nomad_camels.tests.protocol_test.test_while_loop(qtbot, tmp_path)

Opens the config for a “While Loop” and tries to configure it with the condition being While_Loop_Count < 5. Into the loop, a wait-step is added. Tries to run a protocol with this step.

nomad_camels.tests.startup_test module

class nomad_camels.tests.startup_test.MockDialog(*args, **kwargs)

Bases: object

exec()
nomad_camels.tests.startup_test.app()
nomad_camels.tests.startup_test.instance(app)
nomad_camels.tests.startup_test.test_import_thread(qtbot)

Test the ImportThread class.

nomad_camels.tests.startup_test.test_set_progress(instance)
nomad_camels.tests.startup_test.test_set_text(instance)
nomad_camels.tests.startup_test.test_start_camels(qtbot, capfd)

Test the startup of the CAMELS application.

Module contents