#273: Remove nose dependency for graphs_trees/ (#277)

This commit is contained in:
Donne Martin
2020-07-10 21:02:32 -04:00
committed by GitHub
parent 139e157250
commit abf7524c26
67 changed files with 860 additions and 1027 deletions

View File

@@ -1,9 +1,10 @@
from nose.tools import assert_equal
import unittest
class TestTree(object):
class TestTree(unittest.TestCase):
def __init__(self):
def __init__(self, *args, **kwargs):
super(TestTree, self).__init__()
self.results = Results()
def test_tree_one(self):
@@ -14,7 +15,7 @@ class TestTree(object):
bst.insert(1)
bst.insert(3)
in_order_traversal(bst.root, self.results.add_result)
assert_equal(str(self.results), '[1, 2, 3, 5, 8]')
self.assertEqual(str(self.results), '[1, 2, 3, 5, 8]')
self.results.clear_results()
def test_tree_two(self):
@@ -25,7 +26,7 @@ class TestTree(object):
bst.insert(4)
bst.insert(5)
in_order_traversal(bst.root, self.results.add_result)
assert_equal(str(self.results), '[1, 2, 3, 4, 5]')
self.assertEqual(str(self.results), '[1, 2, 3, 4, 5]')
print('Success: test_tree')
@@ -37,4 +38,4 @@ def main():
if __name__ == '__main__':
main()
main()