Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
chore: fix pre-commit codespell error
Browse files Browse the repository at this point in the history
  • Loading branch information
sozelfist committed May 27, 2024
1 parent 6961324 commit 1dd940c
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion algorithms/graph/bipartile/max_bipartile_matching.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_graph_with_multiple_matchings(self):
expected1 = {"U1": "V1", "U2": "V2", "U3": "V3"}
expected2 = {"U1": "V2", "U2": "V1", "U3": "V3"}
result = max_bipartite_matching(graph)
self.assertIn(result, [expected1, expected2])
self.assertTrue(result in [expected1, expected2])


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions algorithms/graph/cyclic/shortest_weighted_cycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def test_remove_edge(self):

def test_add_edge(self):
self.g.add_edge(2, 5, 4)
self.assertIn((5, 4), self.g.adj[2])
self.assertIn((2, 4), self.g.adj[5])
self.assertTrue((5, 4) in self.g.adj[2])
self.assertTrue((2, 4) in self.g.adj[5])


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion algorithms/graph/graph_representation/basic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_neighbors(self):

def test_add_vertex(self):
self.graph.add_vertex("C")
self.assertIn("C", self.graph.vertices)
self.assertTrue("C" in self.graph.vertices)

def test_remove_vertex(self):
self.graph.remove_vertex("B")
Expand Down
6 changes: 3 additions & 3 deletions algorithms/graph/graph_representation/oo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def test_add_vertex(self):
g.add_vertex(a)
g.add_vertex(b)
self.assertEqual(len(g.graph_dict), 2)
self.assertIn("A", g.graph_dict)
self.assertIn("B", g.graph_dict)
self.assertTrue("A" in g.graph_dict)
self.assertTrue("B" in g.graph_dict)

def test_add_edge(self):
g = Graph()
Expand All @@ -39,7 +39,7 @@ def test_add_edge(self):
g.add_vertex(a)
g.add_vertex(b)
g.add_edge("A", "B", 1)
self.assertIn("B", g.graph_dict["A"].edges)
self.assertTrue("B" in g.graph_dict["A"].edges)
self.assertEqual(g.graph_dict["A"].edges["B"], 1)


Expand Down
2 changes: 1 addition & 1 deletion algorithms/searching/interpolation_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_duplicate_elements(self):
arr = [1, 2, 3, 4, 4, 5, 6]
x = 4
result = interpolation_search(arr, x)
self.assertIn(result, [3, 4], "Incorrect result with duplicate elements")
self.assertTrue(result in [3, 4], "Incorrect result with duplicate elements")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion algorithms/searching/linear_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_duplicate_elements(self):
arr = [1, 2, 3, 4, 4, 5, 6]
x = 4
result = linear_search(arr, x)
self.assertIn(result, [3, 4], "Incorrect result with duplicate elements")
self.assertTrue(result in [3, 4], "Incorrect result with duplicate elements")


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions data_structures/graphs/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ def setUp(self):

def test_add_vertex(self):
self.graph.add_vertex(4)
self.assertIn(4, self.graph.get_vertices())
self.assertTrue(4 in self.graph.get_vertices())

def test_add_edge(self):
self.graph.add_edge(3, 1)
self.assertIn(1, self.graph.get_edges()[3])
self.assertTrue(1 in self.graph.get_edges()[3])

def test_get_vertices(self):
self.assertEqual(self.graph.get_vertices(), [1, 2, 3])
Expand Down
4 changes: 2 additions & 2 deletions data_structures/graphs/weighted_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def setUp(self):

def test_add_vertex(self):
self.graph.add_vertex(4)
self.assertIn(4, self.graph.get_vertices())
self.assertTrue(4 in self.graph.get_vertices())

def test_add_edge(self):
self.graph.add_edge(3, 1, 30)
self.assertIn(1, self.graph.get_edges()[3])
self.assertTrue(1 in self.graph.get_edges()[3])
self.assertEqual(self.graph.get_edges()[3][1], 30)

def test_get_vertices(self):
Expand Down
2 changes: 1 addition & 1 deletion data_structures/map/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def test_len(self):
def test_iter(self):
keys = {"a", "b", "c"}
for k, _v in self.m:
self.assertIn(k, keys)
self.assertTrue(k in keys)

def test_str(self):
self.assertEqual(str(self.m), "{a: 1, b: 2, c: 3}")
Expand Down

0 comments on commit 1dd940c

Please sign in to comment.