Exemplo n.º 1
0
def setup_function(function):
    """Creates a GPG key if necessary"""

    if gnupg is None:
        # gnupg is not installed
        return

    global fingerprint
    if fingerprint2keyid(config["gpg_key_fingerprint"]) is None:
        # No GPG key is configured
        fingerprint = genkey(key_name="pyspread_test_key")
    else:
        # Use preconfigured key
        fingerprint = config_fingerprint
Exemplo n.º 2
0
def setup_function(function):
    """Creates a GPG key if necessary"""

    if gnupg is None:
        # gnupg is not installed
        return

    global fingerprint
    if fingerprint2keyid(config["gpg_key_fingerprint"]) is None:
        # No GPG key is configured
        fingerprint = genkey(key_name="pyspread_test_key")
    else:
        # Use preconfigured key
        fingerprint = config_fingerprint
Exemplo n.º 3
0
    def setup_method(self, method):

        # Generate a GPG key if not present
        if fingerprint2keyid(config["gpg_key_fingerprint"]) is None and \
           genkey is not None:
            # No GPG key is configured
            self.fingerprint = genkey(key_name="pyspread_test_key")
        else:
            # Use preconfigured key
            self.fingerprint = config["gpg_key_fingerprint"]

        self.main_window = MainWindow(None, title="pyspread", S=None)
        self.grid = self.main_window.grid
        self.code_array = self.grid.code_array

        # Sign files in order to get valid signatures for current key
        self.grid.actions.sign_file(self.filename_valid_sig)
        self.grid.actions.sign_file(self.filename_gridsize)
Exemplo n.º 4
0
    def setup_method(self, method):

        # Generate a GPG key if not present
        if fingerprint2keyid(config["gpg_key_fingerprint"]) is None and \
           genkey is not None:
            # No GPG key is configured
            self.fingerprint = genkey(key_name="pyspread_test_key")
        else:
            # Use preconfigured key
            self.fingerprint = config["gpg_key_fingerprint"]

        self.main_window = MainWindow(None, title="pyspread", S=None)
        self.grid = self.main_window.grid
        self.code_array = self.grid.code_array

        # Sign files in order to get valid signatures for current key
        self.grid.actions.sign_file(self.filename_valid_sig)
        self.grid.actions.sign_file(self.filename_gridsize)