def setUp(self):
     self.conf = ConfigFacade([
         ConfigItem("site", "site1", []),
         ConfigItem("site", "site2", []),
         ConfigItem("arbitrator", "arbitrator1", []),
         ConfigItem("ticket", "ticketA", []),
     ])
Exemple #2
0
 def test_add_authfile(self):
     conf = ConfigFacade(self.conf_struct_base + self.conf_struct_tickets)
     conf.set_authfile("/path/to/auth.file")
     self.assertEqual(
         conf.config,
         ([ConfigItem("authfile", "/path/to/auth.file", [])] +
          self.conf_struct_base + self.conf_struct_tickets),
     )
Exemple #3
0
 def setUp(self):
     self.conf_struct = [
         ConfigItem("site", "site1", []),
         ConfigItem("site", "site2", []),
         ConfigItem("arbitrator", "arbitrator1", []),
         ConfigItem("ticket", "ticketA", []),
         ConfigItem("ticket", "ticketB", [ConfigItem("timeout", "10", [])]),
     ]
     self.conf = ConfigFacade(self.conf_struct[:])
Exemple #4
0
 def setUp(self):
     self.conf_struct_base = [
         ConfigItem("site", "site1", []),
         ConfigItem("site", "site2", []),
         ConfigItem("arbitrator", "arbitrator1", []),
     ]
     self.conf_struct_ticket_a = [
         ConfigItem("ticket", "ticketA", []),
     ]
     self.conf_struct_ticket_b = [
         ConfigItem("ticket", "ticketB", []),
     ]
     self.conf_struct = (self.conf_struct_base + self.conf_struct_ticket_a +
                         self.conf_struct_ticket_b)
     self.conf = ConfigFacade(self.conf_struct[:])
Exemple #5
0
 def test_change_authfile(self):
     conf = ConfigFacade(
         self.conf_struct_base
         +
         [
             ConfigItem("authfile", "/old/path/to/auth1.file", []),
             ConfigItem("authfile", "/old/path/to/auth2.file", []),
         ]
         +
         self.conf_struct_tickets
     )
     conf.set_authfile("/path/to/auth.file")
     self.assertEqual(
         conf.config,
         (
             [ConfigItem("authfile", "/path/to/auth.file", [])]
             +
             self.conf_struct_base
             +
             self.conf_struct_tickets
         )
     )