示例#1
0
 def test_set_immutable_property_now_not_in_cert(self):
     existing_repo = Repo('testrepo')
     existing_repo['proxy_username'] = "******"
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     # Immutable properties should be always be added/updated,
     # and removed if undefined in the new repo definition.
     self.assertFalse("proxy_username" in existing_repo.keys())
示例#2
0
 def test_set_mutable_property_now_empty_value(self):
     existing_repo = Repo('testrepo')
     existing_repo['metadata_expire'] = "blah"
     incoming_repo = {'metadata_expire': ''}
     existing_repo.update(incoming_repo)
     # re comments in repolib
     # Mutable properties should be added if not currently defined,
     # otherwise left alone.
     self.assertTrue("metadata_expire" in existing_repo.keys())
示例#3
0
 def test_set_immutable_property_now_empty(self):
     existing_repo = Repo('testrepo')
     existing_repo['proxy_username'] = "******"
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     self.assertFalse("proxy_username" in existing_repo.keys())
示例#4
0
 def test_unset_immutable_property(self):
     existing_repo = Repo('testrepo')
     incoming_repo = {'name': "woof"}
     existing_repo.update(incoming_repo)
     self.assertEqual("woof", existing_repo['name'])
示例#5
0
 def test_unset_mutable_property(self):
     existing_repo = Repo('testrepo')
     incoming_repo = {'metadata_expire': 2000}
     existing_repo.update(incoming_repo)
     self.assertEqual(2000, existing_repo['metadata_expire'])
示例#6
0
 def test_mutable_property_in_repo_but_not_in_cert(self):
     existing_repo = Repo('testrepo')
     existing_repo['metadata_expire'] = 1000
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     self.assertEqual(1000, existing_repo['metadata_expire'])
示例#7
0
 def test_gpgcheck_is_mutable(self):
     existing_repo = Repo('testrepo')
     existing_repo['gpgcheck'] = "0"
     incoming_repo = {'gpgcheck': "1"}
     existing_repo.update(incoming_repo)
     self.assertEqual("0", existing_repo['gpgcheck'])
示例#8
0
 def test_empty_strings_not_set_in_file(self):
     r = Repo('testrepo', (('proxy', ""), ))
     r['proxy'] = ""
     self.assertFalse(("proxy", "") in r.items())
     r.update({"proxy": ""})
     self.assertFalse(("proxy", "") in r.items())
示例#9
0
 def test_set_immutable_property_now_empty(self):
     existing_repo = Repo('testrepo')
     existing_repo['proxy_username'] = "******"
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     self.assertFalse("proxy_username" in existing_repo.keys())
示例#10
0
 def test_unset_immutable_property(self):
     existing_repo = Repo('testrepo')
     incoming_repo = {'name': "woof"}
     existing_repo.update(incoming_repo)
     self.assertEqual("woof", existing_repo['name'])
示例#11
0
 def test_unset_mutable_property(self):
     existing_repo = Repo('testrepo')
     incoming_repo = {'metadata_expire': 2000}
     existing_repo.update(incoming_repo)
     self.assertEqual(2000, existing_repo['metadata_expire'])
示例#12
0
 def test_mutable_property_in_repo_but_not_in_cert(self):
     existing_repo = Repo('testrepo')
     existing_repo['metadata_expire'] = 1000
     incoming_repo = {}
     existing_repo.update(incoming_repo)
     self.assertEqual(1000, existing_repo['metadata_expire'])
示例#13
0
 def test_gpgcheck_is_mutable(self):
     existing_repo = Repo('testrepo')
     existing_repo['gpgcheck'] = "0"
     incoming_repo = {'gpgcheck': "1"}
     existing_repo.update(incoming_repo)
     self.assertEqual("0", existing_repo['gpgcheck'])