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_dal.test_bad ( test,
obj,
field,
values )
Tests I can not set bad values to certain fields

Definition at line 28 of file test_dal.py.

28def test_bad(test, obj, field, values):
29 """Tests I can not set bad values to certain fields"""
30 for v in values:
31 test.assertRaises(ValueError, setattr, obj, field, v)
32
33

◆ test_good()

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

Definition at line 21 of file test_dal.py.

21def test_good(test, obj, field, values):
22 """Tests I can set good expected values to certain fields"""
23 for v in values:
24 setattr(obj, field, v)
25 test.assertEqual(getattr(obj, field), v)
26
27

Variable Documentation

◆ RECURSION_TEST

int test_dal.RECURSION_TEST = 500

Definition at line 18 of file test_dal.py.

◆ scriptsdir

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

Definition at line 12 of file test_dal.py.

◆ SIZE_TEST

int test_dal.SIZE_TEST = 1000

Definition at line 17 of file test_dal.py.

◆ test

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

Definition at line 15 of file test_dal.py.