MCPcopy Index your code
hub / github.com/OmkarPathak/pygorithm / test_bfs

Method test_bfs

tests/test_searching.py:48–61  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46
47class TestBFSSearch(unittest.TestCase):
48 def test_bfs(self):
49 self.graph = {
50 'A': {'B', 'C', 'E'},
51 'B': {'A', 'D', 'F'},
52 'C': {'A', 'G'},
53 'D': {'B'},
54 'F': {'B'},
55 'E': {'A'},
56 'G': {'C'}
57 }
58 result = breadth_first_search.search(self.graph, 'A')
59 self.assertEqual(result, {'A', 'B', 'D', 'F', 'C', 'G', 'E'})
60 result = breadth_first_search.search(self.graph, 'G')
61 self.assertEqual(result, {'G', 'C', 'A', 'B', 'D', 'F', 'E'})
62
63
64class TestDFSSearch(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected