Ejemplo n.º 1
0
def test_database_operation():
    """Test setting, getting, deleting a value from the database.

    """
    root = RootTask()
    root.write_in_database('test', 1)
    assert root.get_from_database('test') == 1
    root.remove_from_database('test')
    with pytest.raises(KeyError):
        root.get_from_database('test')
Ejemplo n.º 2
0
 def setup(self):
     root = RootTask()
     root.should_pause = Event()
     root.should_stop = Event()
     root.paused = Event()
     root.resumed = Event()
     root.default_path = 'toto'
     root.write_in_database('meas_name', 'M')
     root.write_in_database('meas_id', '001')
     self.root = root
Ejemplo n.º 3
0
def test_database_operation():
    """Test setting, getting, deleting a value from the database.

    """
    root = RootTask()
    root.write_in_database('test', 1)
    assert root.get_from_database('test') == 1
    root.remove_from_database('test')
    with pytest.raises(KeyError):
        root.get_from_database('test')