-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_graph.py
More file actions
44 lines (27 loc) · 1.04 KB
/
test_graph.py
File metadata and controls
44 lines (27 loc) · 1.04 KB
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
from graph import *
from graph_factory import *
# Very good tests kappa
def test_print_matrix():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert graph.print_matrix() != ""
def test_connect():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert graph.connect() == None
def test_find_subgraphs():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert len(graph.find_subgraphs()) > 0
def test_remove_tops():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert graph.remove_tops(3) == None
def test_add_tops():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert graph.add_tops(3) == None
def test_add_pendant():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert graph.add_pendant() == None
def test_remove_pendant():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert graph.remove_pendant() == None
def test_get_color_map():
graph = GraphFactory.generate_networkx_matrix(3, 0.8)
assert len(graph.get_color_map(2)) == 3