Skip to content

Commit 1314fd0

Browse files
meatballsmarcharper
authored andcommitted
Use call to method under test instead of dumb stupid previous mistake
1 parent 96c7e62 commit 1314fd0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

axelrod/tests/unit/test_graph.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def test_out_dict(self):
9494
2: {1: None, 3: None},
9595
3: {2: None}
9696
}
97-
self.assertEqual(g.out_mapping, expected_out_mapping)
97+
for key in expected_out_mapping:
98+
self.assertEqual(g.out_dict(key), expected_out_mapping[key])
9899

99100
# Undirected graph with vertices and weighted edges
100101
g = graph.Graph(edges=[[1, 2, 10], [2, 3, 5]])
@@ -103,15 +104,17 @@ def test_out_dict(self):
103104
2: {1: 10, 3: 5},
104105
3: {2: 5}
105106
}
106-
self.assertEqual(g.out_mapping, expected_out_mapping)
107+
for key in expected_out_mapping:
108+
self.assertEqual(g.out_dict(key), expected_out_mapping[key])
107109

108110
# Directed graph with vertices and weighted edges
109111
g = graph.Graph(edges=[[1, 2, 10], [2, 3, 5]], directed=True)
110112
expected_out_mapping = {
111113
1: {2: 10},
112114
2: {3: 5},
113115
}
114-
self.assertEqual(g.out_mapping, expected_out_mapping)
116+
for key in expected_out_mapping:
117+
self.assertEqual(g.out_dict(key), expected_out_mapping[key])
115118

116119
def test_in_dict(self):
117120
# Undirected graph with vertices and unweighted edges
@@ -121,7 +124,8 @@ def test_in_dict(self):
121124
2: {1: None, 3: None},
122125
3: {2: None}
123126
}
124-
self.assertEqual(g.in_mapping, expected_in_mapping)
127+
for key in expected_in_mapping:
128+
self.assertEqual(g.in_dict(key), expected_in_mapping[key])
125129

126130
# Undirected graph with vertices and weighted edges
127131
g = graph.Graph(edges=[[1, 2, 10], [2, 3, 5]])
@@ -130,15 +134,17 @@ def test_in_dict(self):
130134
2: {1: 10, 3: 5},
131135
3: {2: 5}
132136
}
133-
self.assertEqual(g.in_mapping, expected_in_mapping)
137+
for key in expected_in_mapping:
138+
self.assertEqual(g.in_dict(key), expected_in_mapping[key])
134139

135140
# Directed graph with vertices and weighted edges
136141
g = graph.Graph(edges=[[1, 2, 10], [2, 3, 5]], directed=True)
137142
expected_in_mapping = {
138143
2: {1: 10},
139144
3: {2: 5}
140145
}
141-
self.assertEqual(g.in_mapping, expected_in_mapping)
146+
for key in expected_in_mapping:
147+
self.assertEqual(g.in_dict(key), expected_in_mapping[key])
142148

143149
def test_repr(self):
144150
# Undirected graph with no vertices

0 commit comments

Comments
 (0)