コード例 #1
0
 def setup_class(cls):
     cls.pipeline = StandardPipeline()
     config = ConfigManager()
     filename = os.path.dirname(__file__)
     path = os.path.join(filename, "../../Top/RefTopologyAppDictionary.xml")
     cls.pipeline.setup(config, path)
     cls.pipeline.connect("127.0.0.1", 50050)
     logpath = os.path.join(filename, "./logs")
     cls.api = IntegrationTestAPI(cls.pipeline, logpath)
     cls.case_list = []  # TODO find a better way to do this.
コード例 #2
0
def initialize_test_api(
    app_dictionary_path: str,
    log_path: str = None,
    server_ip: str = "127.0.0.1",
    server_port: int = 50050,
) -> IntegrationTestAPI:
    """
    Initializes an Integration Test API instance for use.

    Note that these MUST be manually disconnected when you're done using them,
    by calling "pipeline.disconnect()" and "api.teardown()", respectively.

    :param app_dictionary_path: A string path from the current working directory
        to the "<project name>AppDictionary.xml" file for the project you're
        using the API with
    :param log_path: A string path to where files should be logged, or "None" if
        you only want console output
    :param server_ip: The IP of the GDS server you want to connect to
    :param server_port: The port for the Test API on the GDS server
    """
    pipeline = StandardPipeline()
    pipeline.setup(ConfigManager(), app_dictionary_path, "/tmp")
    pipeline.connect(server_ip, server_port)

    # instantiate Test API (log_path of "None" will disable Test API logging)
    api = IntegrationTestAPI(pipeline, log_path)

    return (pipeline, api)
コード例 #3
0
 def setup_class(cls):
     cls.pipeline = StandardPipeline()
     config = ConfigManager()
     filename = os.path.dirname(__file__)
     path = os.path.join(
         filename,
         "../../build-artifacts/raspberrypi/dict/RPITopologyAppDictionary.xml",
     )
     cls.pipeline.setup(config, path, "/tmp")
     cls.pipeline.connect("127.0.0.1", 50050)
     logpath = os.path.join(filename, "./logs")
     cls.api = IntegrationTestAPI(cls.pipeline, logpath)
     cls.case_list = []  # TODO find a better way to do this.
     cls.dictionary = path
コード例 #4
0
 def setup_class(cls):
     try:
         cls.pipeline = StandardPipeline()
         config = ConfigManager()
         filename = os.path.dirname(__file__)
         path = os.path.join(
             filename,
             "../../build-artifacts/{}/dict/RefTopologyAppDictionary.xml".
             format(platform.system()),
         )
         logpath = os.path.join(filename, "./logs")
         cls.pipeline.setup(config, path, "/tmp")
         cls.api = IntegrationTestAPI(cls.pipeline, logpath)
         cls.case_list = []  # TODO find a better way to do this.
         cls.dictionary = path
         cls.pipeline.connect("tcp://127.0.0.1:50050")
     except Exception as exc:
         print(f"[WARNING] Exception in setup: {exc}")
         cls.teardown_class()
         raise
コード例 #5
0
 def __init__(self):
     self.command_count = 0
     self.t0 = TimeType()
     StandardPipeline.__init__(self)