Exemplo n.º 1
0
 def test_signing_config_as_dict_method(self):
     d_reference = {
         "skip": False,
         "batch": True,
         "gpgkey": "xxx",
         "keyring": None,
         "secret_keyring": None,
         "passphrase": "password",
         "passphrase_file": None
     }
     c = SigningConfig(**d_reference)
     d = c.as_dict()
     assert d == d_reference
Exemplo n.º 2
0
 def test_signing_config_as_dict_method_with_prefix(self):
     d_init = {
         "skip": False,
         "batch": True,
         "gpgkey": "xxx",
         "keyring": None,
         "secret_keyring": None,
         "passphrase": "password",
         "passphrase_file": None
     }
     d_reference = {}
     for k, v in d_init.items():
         d_reference["sign_" + k] = v
     c = SigningConfig(**d_init)
     d = c.as_dict(prefix="sign_")
     assert d == d_reference
Exemplo n.º 3
0
 def test_signing_config_unknown_key_arg(self):
     with pytest.raises(AptlyCtlError) as e:
         c = SigningConfig(skip=True, unknown="unknown")
     assert "unknown configuration keys: ['unknown=unknown']" in e.value.args[
         0].lower()
Exemplo n.º 4
0
 def test_signing_config_skip_true(self):
     assert SigningConfig(skip=True) is not None
Exemplo n.º 5
0
 def test_signing_config_none_passphrase_passphrase_file(self):
     with pytest.raises(AptlyCtlError):
         c = SigningConfig(skip=False, gpgkey="xxx")
Exemplo n.º 6
0
 def test_signing_config_both_passphrase_passphrase_file(self):
     with pytest.raises(AptlyCtlError):
         c = SigningConfig(skip=False,
                           gpgkey="xxx",
                           passphrase="password",
                           passphrase_file="pass_file")
Exemplo n.º 7
0
 def test_signing_config_no_gpgkey(self):
     with pytest.raises(AptlyCtlError):
         c = SigningConfig(skip=False, passphrase="password")
Exemplo n.º 8
0
 def test_signing_config_attrs_unsettable(self):
     c = SigningConfig(gpgkey="xxx", passphrase="password")
     for attr in self.signning_config_attrs:
         with pytest.raises(AttributeError):
             setattr(c, attr, "somevalule")
Exemplo n.º 9
0
 def test_signing_config_has_necessary_attrs(self):
     c = SigningConfig(gpgkey="xxx", passphrase="password")
     for attr in self.signning_config_attrs:
         assert hasattr(c, attr) is True