# Path: common/data_structures.py
# class Node(object):
# 
#     def __init__(self):
#         self.children = list()
# 
#     def add_child(self, child):
#         self.children.append(child)
# 
#     def get_child(self, index):
#         return self.children[index]
# 
#     def __iter__(self):
#         return iter(self.children)
# 
#     def __eq__(self, other):
#         return self.value == other.value
# 
# Path: search/uninformed_search.py
# def dls(node, target, limit, comparator=lambda x, y: x == y):
#     queue = [(node, 0)]
#     visited_nodes = []
#     max_level = 0
# 
#     while len(queue) != 0:
#         current_node, current_node_level = queue.pop()
#         max_level = max(max_level, current_node_level)
# 
#         if current_node_level <= limit and current_node not in visited_nodes:
#                 if comparator(current_node.value, target):
#                     return current_node, current_node_level
# 
#                 if current_node_level < limit:
#                     queue.extend([(child, current_node_level + 1) for child in current_node])
# 
#                 visited_nodes.append(current_node)
# 
#     return None, max_level


from unittest.case import TestCase
from common.data_structures import Node
from search.uninformed_search import dls


class DepthLimitedSearchTest(TestCase):

    @staticmethod
    def prepare_tree1():

# Path: common/data_structures.py
# class Node(object):
# 
#     def __init__(self):
#         self.children = list()
# 
#     def add_child(self, child):
#         self.children.append(child)
# 
#     def get_child(self, index):
#         return self.children[index]
# 
#     def __iter__(self):
#         return iter(self.children)
# 
#     def __eq__(self, other):
#         return self.value == other.value
# 
# Path: search/uninformed_search.py
# def dls(node, target, limit, comparator=lambda x, y: x == y):
#     queue = [(node, 0)]
#     visited_nodes = []
#     max_level = 0
# 
#     while len(queue) != 0:
#         current_node, current_node_level = queue.pop()
#         max_level = max(max_level, current_node_level)
# 
#         if current_node_level <= limit and current_node not in visited_nodes:
#                 if comparator(current_node.value, target):
#                     return current_node, current_node_level
# 
#                 if current_node_level < limit:
#                     queue.extend([(child, current_node_level + 1) for child in current_node])
# 
#                 visited_nodes.append(current_node)
# 
#     return None, max_level


# Path: tests/search/dls_test.py
from unittest.case import TestCase
from common.data_structures import Node
from search.uninformed_search import dls



class DepthLimitedSearchTest(TestCase):

    @staticmethod
    def prepare_tree1():

        node = Node()