コード例 #1
0
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
ファイル: device.py プロジェクト: carr-elagheb/moler
    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()
コード例 #5
0
def device_config():
    import moler.config.devices as dev_cfg
    yield dev_cfg
    # restore since tests may change configuration
    dev_cfg.clear()