Skip to content

Commit b18ecf4

Browse files
committed
TreeNode test added, working correct
1 parent 8c9a717 commit b18ecf4

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

pydatastructs/utils/misc_util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import math, pydatastructs
22
from enum import Enum
3-
# from pydatastructs.utils._backend.cpp import _nodes
3+
# from pydatastructs.utils._backend.cpp import _nodes # Check why _nodes can't be imported here
44

55
__all__ = [
66
'TreeNode',
@@ -74,7 +74,6 @@ def methods(cls):
7474

7575
def __new__(cls, key, data=None, **kwargs):
7676
backend = kwargs.get('backend', Backend.PYTHON)
77-
# print("backend checked")
7877
if backend == Backend.CPP:
7978
print("Backend switched to C++")
8079
# return _nodes.TreeNode(key, data, **kwargs)

pydatastructs/utils/tests/test_misc_util.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
from pydatastructs.utils.misc_util import Backend
55
from pydatastructs.utils._backend.cpp import _nodes
66

7-
def test_TreeNode():
8-
n = _nodes.TreeNode(None,1,100)
7+
def test_cpp_TreeNode():
8+
n = _nodes.TreeNode(1,100)
99
print(str(n))
1010
assert str(n) == "(None, 1, 100, None)"
1111

12-
13-
1412
def test_AdjacencyListGraphNode():
1513
g_1 = AdjacencyListGraphNode('g_1', 1)
1614
g_2 = AdjacencyListGraphNode('g_2', 2)
@@ -59,5 +57,3 @@ def test_RedBlackTreeNode():
5957
def test_SkipNode():
6058
c = SkipNode(1)
6159
assert str(c) == '(1, None)'
62-
63-
test_TreeNode()

0 commit comments

Comments
 (0)