mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-09 19:08:02 +00:00
@@ -1,9 +1,10 @@
|
||||
from nose.tools import assert_equal
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBfs(object):
|
||||
class TestBfs(unittest.TestCase):
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(TestBfs, self).__init__()
|
||||
self.results = Results()
|
||||
|
||||
def test_bfs(self):
|
||||
@@ -13,7 +14,7 @@ class TestBfs(object):
|
||||
bst.insert(1)
|
||||
bst.insert(3)
|
||||
bst.bfs(self.results.add_result)
|
||||
assert_equal(str(self.results), '[5, 2, 8, 1, 3]')
|
||||
self.assertEqual(str(self.results), '[5, 2, 8, 1, 3]')
|
||||
|
||||
print('Success: test_bfs')
|
||||
|
||||
@@ -24,4 +25,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user