def clear_all_cfg():
    import moler.config as moler_cfg
    import moler.config.devices as dev_cfg
    from moler.device.device import DeviceFactory as dev_factory

    moler_cfg.clear()
    dev_cfg.clear()
    dev_factory._clear()
示例#2
0
    def remove_all_devices(cls):
        """
        Remove all created devices.

        :return: None
        """
        devices = copy_list(cls._devices.keys(), deep_copy=False)
        for device_name in devices:
            cls.remove_device(name=device_name)
        devices_config.clear()
示例#3
0
    def remove_all_devices(cls, clear_device_history=False):
        """
        Remove all created devices.

        :param clear_device_history: set True to clear the history of devices. Caution: you may overwrite your logs!
        :return: None
        """
        devices = copy_list(cls._devices.keys(), deep_copy=False)
        for device_name in devices:
            cls.remove_device(name=device_name)
        devices_config.clear()
        if clear_device_history:
            MolerTest.warning(
                "All history of devices will be forgotten. The same names can be used again with"
                " different meaning!")
            cls._clear()
示例#4
0
文件: __init__.py 项目: nokia/moler
def clear():
    """Cleanup Moler's configuration"""
    global loaded_config
    loaded_config = ["NOT_LOADED_YET"]
    conn_cfg.clear()
    dev_cfg.clear()
def device_config():
    import moler.config.devices as dev_cfg
    yield dev_cfg
    # restore since tests may change configuration
    dev_cfg.clear()