# 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: vespa/ho_ph.py
# class HO_PH(HO):
#     """Create an horizontal orchestrator to handle agents at the physical
#     level.
# 
#     :return: The HO to gather and react on physical agents.
#     :rtype: Node
#     """
# 
#     def __init__(self, name, host, port, master, run=True):
#         super(HO_PH, self).__init__(name, host, port, master, run)
#         self.have_backend = False
# 
#     def send(self, msg):
#         """Overload the internal send() to capture and send messages to the
#         backend
# 
#         :param str msg: The massage to process and to send
#         :return: The backend response
#         :rtype: str
#         """
#         data = super(HO_PH, self).send(msg)
#         # self.sendRemote( self.master, data )
#         return data
# 
#     def ninjaMethod(self):
#         """Empty function for tests
#         """
#         pass


import pytest
import sys
import os
from vespa.ho import HO
from vespa.ho_ph import HO_PH

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



@pytest.fixture(scope='module')
def ho_ph_instance():
    v = HO_PH('testnode', "127.0.0.1", 1337, None, run=False)
    return v


# 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: vespa/ho_ph.py
# class HO_PH(HO):
#     """Create an horizontal orchestrator to handle agents at the physical
#     level.
# 
#     :return: The HO to gather and react on physical agents.
#     :rtype: Node
#     """
# 
#     def __init__(self, name, host, port, master, run=True):
#         super(HO_PH, self).__init__(name, host, port, master, run)
#         self.have_backend = False
# 
#     def send(self, msg):
#         """Overload the internal send() to capture and send messages to the
#         backend
# 
#         :param str msg: The massage to process and to send
#         :return: The backend response
#         :rtype: str
#         """
#         data = super(HO_PH, self).send(msg)
#         # self.sendRemote( self.master, data )
#         return data
# 
#     def ninjaMethod(self):
#         """Empty function for tests
#         """
#         pass


# Path: tests/test_ho_ph.py
import pytest
import sys
import os
from vespa.ho import HO
from vespa.ho_ph import HO_PH


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



@pytest.fixture(scope='module')
def ho_ph_instance():
    v = HO_PH('testnode', "127.0.0.1", 1337, None, run=False)
    return v


def test_instance_ho_ph(ho_ph_instance):