Beispiel #1
0
 def test_config_init_cfg_overrides(self, goodConfigPath):
     url = "http://1.1.1.1:11"
     gpgkey =  "111111"
     c = Config(goodConfigPath, 0, ["url=%s" % url, "signing.gpgkey=%s" % gpgkey])
     assert c.url == url
     assert c.get_signing_config().gpgkey == gpgkey
     assert c.name == "profile0"
Beispiel #2
0
 def test_init_no_cfg_only_overrides(self):
     url = "http://1.1.1.1:11"
     gpgkey =  "111111"
     passphrase_file = "/etc/passphrase"
     cfg_overrides = [
             "url=%s" % url,
             "signing.gpgkey=%s" % gpgkey,
             "signing.passphrase_file=%s" % passphrase_file
             ]
     c = Config(False, cfg_overrides=cfg_overrides)
     assert c.url == url
     assert c.get_signing_config().gpgkey == gpgkey
     assert c.get_signing_config().passphrase_file == passphrase_file
     assert hasattr(c, "name") is False
Beispiel #3
0
 def test_get_overrided_signing_config_if_there_are_no_signing_overrides(self, goodConfigPath):
     c = Config(goodConfigPath, 0)
     assert c.get_signing_config().gpgkey == "aba45rts"
     assert c.get_signing_config(PubSpec("./stretch")).gpgkey == "aba45rts"
Beispiel #4
0
 def test_get_overrided_signing_config(self, goodConfigPath):
     c = Config(goodConfigPath, "with_sign")
     assert c.get_signing_config().gpgkey == "default"
     assert c.get_signing_config(PubSpec("./stretch")).gpgkey == "stretch"
     assert c.get_signing_config(PubSpec("debian/jessie")).gpgkey == "jessie"
     assert c.get_signing_config(PubSpec("none/none")).gpgkey == "default"