-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.py
42 lines (33 loc) · 886 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
from wild_six import Nodes, Node, Set, List, Mset, Oset, BadData
N = Nodes(nodes='1b3456')
print(N)
assert N['1'] < N['b']
s1 = Set(from_nodes=N, nodes_labels=['1','3'])
print(s1)
s2 = Set(from_nodes=N, nodes_labels=['3','1'])
assert s1==s2
try:
s = Set(from_nodes=N, nodes_labels=['1','1'])
except BadData as e:
print(e)
try:
s = Set(from_nodes=N, nodes_labels=['x','1'])
except BadData as e:
print(e)
l1 = List(from_nodes=N, nodes_labels=['1','3', 'b', '3'])
print(l1)
l2 = List(from_nodes=N, nodes_labels=['1','3', 'b'])
try:
assert l1 == l2
except AssertionError as e:
print('l1 != l2')
m1 = Mset(from_nodes=N, nodes_labels=['b','b','1'])
print(m1)
o1 = Oset(from_nodes=N, nodes_labels=['1','3','b','4'])
print(o1)
edges = N.edges()
print(edges)
assert edges[0].incident(edges[1])
assert not edges[0].incident(edges[14])
#
assert len(N.meets())==45