-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
61 lines (55 loc) · 788 Bytes
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import nose
import json
from vcd2wavedrom import *
# TODO
test_input = """$date today $end
$timescale 1 ns $end
$scope module top $end
$var reg 1 0 A $end
$var reg 1 1 B $end
$var reg 1 2 sel $end
$var reg 1 3 seln $end
$var reg 1 4 S1 $end
$var reg 1 5 S2 $end
$var reg 1 6 Q $end
$upscope $end
$enddefinitions $end
#0
b0 0
b0 1
b1 2
b0 3
b1 4
b1 5
b0 6
#10
b1 1
#12
b0 5
#14
b1 6
#20
b1 0
#30
b0 2
#32
b1 3
b1 5
#34
b0 4
b0 6
#36
b1 6
"""
custom_title = "TESTtitleTEST"
def test_title():
result = VCD2Wavedrom(test_input, title=custom_title).convert()
assert custom_title in result
def test_json():
try:
json.loads(VCD2Wavedrom(test_input).convert())
except ValueError as err:
assert False
assert True
if __name__ == '__main__':
nose.run()