Bike-X
0.8
Main Page
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
testmsp.py
Go to the documentation of this file.
1
# -*- coding: utf-8 -*-
2
3
"""
4
Simple Unit Test to MSP class
5
"""
6
7
import
unittest
8
import
sys
9
sys.path.append(
'../'
)
10
from
msp430
import
MSP, available_ports
11
from
glob
import
glob
12
13
14
class
TestMSP
(unittest.TestCase):
15
"""docstring for TestMSP"""
16
17
def
shortDescription
(self):
18
return
"Test Microcontroler class"
19
20
def
setUp
(self):
21
""" Sting up """
22
func = str(self.id).split(
'='
)[-1][:-2]
23
func = func.split(
'test_'
)[-1]
24
func = func.replace(
'_'
,
' '
)
25
out =
'\rTest of '
+ func +
' '
26
out = out.ljust(65,
'-'
)
27
sys.stderr.write(out)
28
self.
shortDescription
()
29
30
port =
available_ports
()
31
if
port:
32
port = port[0]
33
self.
msp430
= MSP(port)
34
35
def
tearDown
(self):
36
""" Releasing test """
37
sys.stderr.write(
'Done\n'
)
38
39
def
test_message
(self):
40
""" A test """
41
self.assertIsNotNone(self.msp430.adc.read())
42
43
if
__name__ ==
"__main__"
:
44
unittest.main()
device.scripts.tests.testmsp.TestMSP.tearDown
def tearDown
Definition:
testmsp.py:35
device.scripts.tests.testmsp.TestMSP
Definition:
testmsp.py:14
device.scripts.tests.testmsp.TestMSP.setUp
def setUp
Definition:
testmsp.py:20
device.scripts.util.available_ports
def available_ports
Definition:
util.py:32
device.scripts.tests.testmsp.TestMSP.shortDescription
def shortDescription
Definition:
testmsp.py:17
device.scripts.tests.testmsp.TestMSP.test_message
def test_message
Definition:
testmsp.py:39
device.scripts.tests.testmsp.TestMSP.msp430
msp430
Definition:
testmsp.py:33
device
scripts
tests
testmsp.py
Generated on Wed Oct 1 2014 00:45:20 for Bike-X by
1.8.6