# Path: vespa/node.py
# class Node(PThread):
#     # Overrides threading.Thread.run()
#     def run(self):
#         profiler = cProfile.Profile()
#         try:
#             return profiler.runcall(PThread.run, self)
#         finally:
#             profiler.dump_stats('myprofile-%s.profile' % (self.name))
# 
# Path: vespa/ho.py
# class HO(Node):
#     def __init__(self, name, host, port, master, run=True):
#         super(HO, self,).__init__(name, host, port, master, run)
# 
#     def findAgent(self, name):
#         for agent_name, host, port in self.agents:
#             if agent_name == name:
#                 return (agent_name, host, port)
#         raise Exception("Agent %s not present in HO %s." % (name, self.name))


import unittest
import sys
import os
from vespa.node import Node
from vespa.ho import HO

DOSSIER_COURRANT = os.path.dirname(os.path.abspath(__file__))
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURRANT)
sys.path.append(DOSSIER_PARENT)



class TestInit(unittest.TestCase):
    def test_instance_node(self):

# Path: vespa/node.py
# class Node(PThread):
#     # Overrides threading.Thread.run()
#     def run(self):
#         profiler = cProfile.Profile()
#         try:
#             return profiler.runcall(PThread.run, self)
#         finally:
#             profiler.dump_stats('myprofile-%s.profile' % (self.name))
# 
# Path: vespa/ho.py
# class HO(Node):
#     def __init__(self, name, host, port, master, run=True):
#         super(HO, self,).__init__(name, host, port, master, run)
# 
#     def findAgent(self, name):
#         for agent_name, host, port in self.agents:
#             if agent_name == name:
#                 return (agent_name, host, port)
#         raise Exception("Agent %s not present in HO %s." % (name, self.name))


# Path: tests/test_ho.py
import unittest
import sys
import os
from vespa.node import Node
from vespa.ho import HO


DOSSIER_COURRANT = os.path.dirname(os.path.abspath(__file__))
DOSSIER_PARENT = os.path.dirname(DOSSIER_COURRANT)
sys.path.append(DOSSIER_PARENT)



class TestInit(unittest.TestCase):
    def test_instance_node(self):

        v = HO('testnode', "127.0.0.1", 1337, None, run=False)