DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
test_dal Namespace Reference

Classes

class  DalTest

Functions

 test_good (test, obj, field, values)
 test_bad (test, obj, field, values)

Variables

 scriptsdir = os.path.dirname(os.path.realpath(__file__))
 test = conffwk.dal.module('test', f'{scriptsdir}/test.schema.xml')
int SIZE_TEST = 1000
int RECURSION_TEST = 500

Detailed Description

Unit test for the Python bindings to the DAL.

Function Documentation

◆ test_bad()

test_bad ( test,
obj,
field,
values )
Tests I can not set bad values to certain fields

Definition at line 33 of file test_dal.py.

33def test_bad(test, obj, field, values):
34 """Tests I can not set bad values to certain fields"""
35 for v in values:
36 test.assertRaises(ValueError, setattr, obj, field, v)
37
38

◆ test_good()

test_good ( test,
obj,
field,
values )
Tests I can set good expected values to certain fields

Definition at line 26 of file test_dal.py.

26def test_good(test, obj, field, values):
27 """Tests I can set good expected values to certain fields"""
28 for v in values:
29 setattr(obj, field, v)
30 test.assertEqual(getattr(obj, field), v)
31
32

Variable Documentation

◆ RECURSION_TEST

int test_dal.RECURSION_TEST = 500

Definition at line 23 of file test_dal.py.

◆ scriptsdir

test_dal.scriptsdir = os.path.dirname(os.path.realpath(__file__))

Definition at line 17 of file test_dal.py.

◆ SIZE_TEST

int test_dal.SIZE_TEST = 1000

Definition at line 22 of file test_dal.py.

◆ test

test_dal.test = conffwk.dal.module('test', f'{scriptsdir}/test.schema.xml')

Definition at line 20 of file test_dal.py.