Fork PyRPL on GitHub

pyrpl.test package

Submodules

pyrpl.test.debug_timer module

pyrpl.test.test_attribute module

class pyrpl.test.test_attribute.DummyModule(parent, name=None)[source]

Bases: pyrpl.modules.Module

Setup Attributes:

  • sub2:
  • sub1:
setup(**kwds)
Sets the module up for acquisition with the current setup attribute values.
sub2
sub1
some_filter
some_number
some_options

Options – [‘foo’, ‘bar’]

sub1
sub2
true_or_false
class pyrpl.test.test_attribute.FirstSubModule(parent, name=None)[source]

Bases: pyrpl.modules.Module

Setup Attributes:

  • b1:
  • b2:
b1
b2
setup(**kwds)
Sets the module up for acquisition with the current setup attribute values.
b1
b2
class pyrpl.test.test_attribute.MyFilterProperty(default=None, doc='', ignore_errors=False, call_setup=False)[source]

Bases: pyrpl.attributes.FilterProperty

valid_frequencies(module)[source]
class pyrpl.test.test_attribute.SecondSubModule(parent, name=None)[source]

Bases: pyrpl.modules.Module

Setup Attributes:

  • b1:
  • b2:
b1
b2
setup(**kwds)
Sets the module up for acquisition with the current setup attribute values.
b1
b2
class pyrpl.test.test_attribute.TestAttributeClass[source]

Bases: pyrpl.test.test_base.TestPyrpl

source_config_file = 'nosetests_source_dummy_module'
test_config_file()[source]
test_dummy_module()[source]
test_submodule()[source]

pyrpl.test.test_base module

class pyrpl.test.test_base.TestPyrpl[source]

Bases: object

base class for all pyrpl tests

OPEN_ALL_DOCKWIDGETS = False
curves = []
classmethod erase_temp_file()[source]
classmethod setUpAll()[source]
source_config_file = 'nosetests_source.yml'
classmethod tearDownAll()[source]
test_pyrpl()[source]
test_read_write_time()[source]
tmp_config_file = 'nosetests_config.yml'

pyrpl.test.test_example module

class pyrpl.test.test_example.TestExample[source]

Bases: pyrpl.test.test_base.TestPyrpl

setup()[source]
test_example()[source]
test_example2()[source]
test_example3()[source]

pyrpl.test.test_load_save module

class pyrpl.test.test_load_save.TestLoadSave[source]

Bases: pyrpl.test.test_base.TestPyrpl

iterates over all modules, prepares a certain state, saves this, messes up the current state, loads the saved state and checks whether attributes are the ones that were saved

assert_load_save_module(mod)[source]
test_load_save()[source]
pyrpl.test.test_load_save.scramble_values(mod, str_val='foo', num_val=12.0, bool_val=True, list_val=[1912], option_index=0, list_length=4)[source]

This function tries to modify all _setup_attributes of the module mod.

The arguments specify the new values for each type of Attribute.

Parameters:
  • mod – Module whose values are to be scrambled.
  • str_val – string value
  • num_val – number value
  • bool_val – etc...
  • list_val
  • option_index
  • list_length
Returns:

lists of all modified attribute names and the set values.

Return type:

attr_names, attr_vals

pyrpl.test.test_lockbox module

class pyrpl.test.test_lockbox.TestLockbox[source]

Bases: pyrpl.test.test_base.TestPyrpl

setup()[source]
source_config_file = 'nosetests_source_lockbox.yml'
test_create_stage()[source]
test_lock()[source]
test_real_lock()[source]

pyrpl.test.test_memory module

class pyrpl.test.test_memory.TestMemory[source]

Bases: object

test_load()[source]
test_two_trees()[source]

makes two different memorytree objects that might have conflicts w.r.t. each other.

The conflicts arise from the latency between the objects in memory and the file defined by _loadsavedeadtime for speed reasons.

test_two_trees_nodeadtime()[source]

makes two different memorytree objects that might have conflicts w.r.t. each other.

When _loadsavedeadtime is set to 0, no conflicts are possible since both memorytrees are always up to date with the file.

test_usage()[source]

tests for the typical use cases of memorytree

pyrpl.test.test_module_widgets module

pyrpl.test.test_na module

class pyrpl.test.test_na.TestNA[source]

Bases: pyrpl.test.test_base.TestPyrpl

coucou()[source]
setup()[source]
teardown()[source]
test_benchmark_gui()[source]

test na speed with gui

test_benchmark_nogui()[source]

test na speed without gui

test_first_na_stopped_at_startup()[source]

This was so hard to detect, I am making a unit test

test_get_curve()[source]
test_iq_autosave_active()[source]

At some point, iq._autosave_active was reinitialized by iq create_widget...

test_iq_stopped_when_paused()[source]
test_na_running_states()[source]
test_no_write_in_config()[source]

Make sure the na isn’t continuously writing to config file, even in running mode. :return:

test_save_curve()[source]
test_stupid_timer()[source]
pyrpl.test.test_na.sine(frequency, duration)[source]

pyrpl.test.test_ownership module

class pyrpl.test.test_ownership.TestOwnership[source]

Bases: pyrpl.test.test_base.TestPyrpl

test_ownership_restored()[source]

pyrpl.test.test_proxyproperty module

class pyrpl.test.test_proxyproperty.MyModule(parent, name=None)[source]

Bases: pyrpl.modules.Module

Setup Attributes:

  • moduleproperty:
moduleproperty
myfloat
myfloatproxy
myselectproxy
setup(**kwds)
moduleproperty
class pyrpl.test.test_proxyproperty.MySubModule(parent, name=None)[source]

Bases: pyrpl.modules.Module

Setup Attributes:

myfloat
myselect

Options – [1, 2, 3, ‘a’, ‘b’, ‘c’]

setup(**kwds)
Sets the module up for acquisition with the current setup attribute values.
class pyrpl.test.test_proxyproperty.SignalReceiver[source]

Bases: object

slots for signals to ensure that signals are properly emitted

change_options(name, options)[source]
change_ownership()[source]
update_attribute_by_name(name, value)[source]
class pyrpl.test.test_proxyproperty.TestProxyProperty[source]

Bases: object

test_proxy()[source]

pyrpl.test.test_pyqtgraph_benchmark module

class pyrpl.test.test_pyqtgraph_benchmark.TestPyqtgraph[source]

Bases: pyrpl.test.test_redpitaya.TestRedpitaya

This test case creates a maximally simplistic scope gui that continuously plots the data of both scope channels, and checks the obtainable frame rate. Frame rates down to 20 Hz are accepted

N = 16384
REDPITAYA = False
cycles = 50
dt = 0.01
duration = 1.0
frequency = 10.0
setup()[source]
teardown()[source]
test_speed()[source]
timeout = 10.0
update_plot()[source]

pyrpl.test.test_redpitaya module

class pyrpl.test.test_redpitaya.TestRedpitaya[source]

Bases: object

classmethod setUpAll()[source]
classmethod tearDownAll()[source]
test_connect()[source]
test_redpitaya()[source]

pyrpl.test.test_registers module

class pyrpl.test.test_registers.TestRegisters[source]

Bases: pyrpl.test.test_redpitaya.TestRedpitaya

This test verifies that all registers behave as expected.

The test is not only useful to test the python interface, but also checks that the fpga is not behaving stragely, i.e. loosing data or writing the wrong data. Thus, it is the principal test to execute on new fpga designs.

register_validation(module, modulekey, reg, regkey)[source]
test_generator()[source]

pyrpl.test.test_spectrum_analyzer module

class pyrpl.test.test_spectrum_analyzer.TestClass[source]

Bases: pyrpl.test.test_base.TestPyrpl

teardown()[source]

make 100% sure that specan has stopped

test_flatness_baseband()[source]
test_flatness_iqmode()[source]
test_iq_filter_white_noise()[source]

Measure the transfer function of an iq filter by measuring the cross-spectrum between white-noise input and output

test_no_write_in_config()[source]

Make sure the spec an isn’t continuously writing to config file, even in running mode. :return:

test_save_curve()[source]
test_specan_stopped_at_startup()[source]

This was so hard to detect, I am making a unit test

test_white_noise_flatness()[source]

Make sure a white noise results in a flat spectrum, with a PSD equal to <V^2> when integrated from 0 Hz to Nyquist frequency. To make sure no aliasing problem occurs, a narrowbandpass filter is used. The test cannot be perfomed for the largest bandwidth because then the transfer function correction for the scope decimation should not be applied for internal signals (however, the sinc correction is applied in practice).

Module contents