Skip to content

Commit 7cd24cc

Browse files
committed
Add in tests for lsl.common.ndp from #75.
1 parent c60ef39 commit 7cd24cc

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

tests/test_ndp.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
""
2+
Unit test for the lsl.common.ndp module.
3+
"""
4+
5+
import warnings
6+
import unittest
7+
import numpy as np
8+
9+
from lsl.common import ndp
10+
from lsl.common import stations
11+
12+
13+
__version__ = "0.1"
14+
__author__ = "Jayce Dowell"
15+
16+
17+
class ndp_bandpass_tests(unittest.TestCase):
18+
"""A unittest.TestCase collection of unit tests for the lsl.common.ndp
19+
module function for the bandpass."""
20+
21+
def setUp(self):
22+
"""Turn off all numpy and python warnings."""
23+
24+
np.seterr(all='ignore')
25+
warnings.simplefilter('ignore')
26+
27+
def test_drx_bandpass(self):
28+
"""Test that the DRX bandpass generator actually runs."""
29+
30+
fnc = ndp.drx_filter(sample_rate=19.6e6, npts=256)
31+
junk = fnc(1e3)
32+
33+
34+
class ndp_test_suite(unittest.TestSuite):
35+
"""A unittest.TestSuite class which contains all of the lsl.common.ndp
36+
module unit tests."""
37+
38+
def __init__(self):
39+
unittest.TestSuite.__init__(self)
40+
41+
loader = unittest.TestLoader()
42+
self.addTests(loader.loadTestsFromTestCase(ndp_bandpass_tests))
43+
44+
45+
if __name__ == '__main__':
46+
unittest.main()
47+

0 commit comments

Comments
 (0)