Esempio n. 1
0
    def setUpClass(self):
        # Wait for the daemon
        print("Waiting for daemon to be ready...")
        devman = openrazer.client.DeviceManager()
        devices = devman.devices
        print("\nDaemon ready. The test will now begin.\n")

        if len(devices) == 0:
            print("\nCannot start test as there are no devices!\n")
            exit(1)

        # No longer needed, as middleman's functions will be used.
        del (devman)

        # Common Polychromatic code
        def _dummy_i18n(string):
            return string

        self.dbg = common.Debugging()
        pref.init(_dummy_i18n)

        self.middleman = middleman.Middleman(self.dbg, common, _dummy_i18n)
        self.middleman.init()

        # Definitely do not download device images
        self.middleman.get_backend("openrazer").allow_image_download = False
Esempio n. 2
0
    def setUpClass(self):
        self.i18n = locales.Locales("polychromatic")
        self._ = self.i18n.init()
        self.dbg = common.Debugging()
        self.paths = common.paths
        preferences.init(self._)

        self.fileman = effects.EffectFileManagement(self.i18n, self._, self.dbg)

        # Dummy content
        self.fileman.save_item(self.fileman.init_data("Test 1", effects.TYPE_LAYERED))
        self.fileman.save_item(self.fileman.init_data("Test 2", effects.TYPE_LAYERED))
        self.fileman.save_item(self.fileman.init_data("Test 3", effects.TYPE_LAYERED))
Esempio n. 3
0
    def setUpClass(self):
        self.i18n = locales.Locales("polychromatic")
        self._ = self.i18n.init()
        self.dbg = common.Debugging()
        self.paths = common.paths
        preferences.init(self._)

        self.fileman = effects.EffectFileManagement(self.i18n, self._,
                                                    self.dbg)

        # Dummy content
        self.fileman.save_item(
            self.fileman.init_data("Test 1", effects.TYPE_LAYERED))
        self.fileman.save_item(
            self.fileman.init_data("Test 2", effects.TYPE_LAYERED))
        self.fileman.save_item(
            self.fileman.init_data("Test 3", effects.TYPE_LAYERED))

        # Unit test resources
        self.res_path = os.path.join(os.path.dirname(__file__), "files")
    from pylib import snapsupport as snapsupport
    from pylib import common as common
except ImportError:
    import software_boutique.snapsupport as snapsupport
    import software_boutique.common as common

# Paths
cache_path = os.path.join(os.path.expanduser('~'), ".cache",
                          "software-boutique")
installed_index = os.path.join(os.path.expanduser('~'), ".config",
                               "software-boutique", "installed.json")
data_source = "/usr/share/ubuntu-mate-welcome/"

# Session Details
force_dummy = False
dbg = common.Debugging()  # Main application will replace this.
system_arch = str(
    subprocess.Popen(["dpkg", "--print-architecture"],
                     stdout=subprocess.PIPE).communicate()[0]).strip('\\nb\'')
current_os_version = platform.dist()[1]  # E.g. 16.04
current_os_codename = platform.dist()[2]  # E.g. xenial

# Default Strings (applications should localise these)
string_dict = {
    "details_text": "Details",
    "details_tooltip": "Learn more about this application",
    "install_text": "Install",
    "install_tooltip": "Install this application on your computer",
    "reinstall_text": "",
    "reinstall_tooltip": "Reinstall this application",
    "remove_text": "",
Esempio n. 5
0
 def setUp(self):
     self._ = locales.Locales("polychromatic").init()
     self.dbg = common.Debugging()
     self.paths = common.paths
     preferences.init(self._)