Exemple #1
0
 def test_render(self):
     self.render = render.Render(self.configration)
     self.render.dumps_to(
         './hatest.cfg')
     parser = parse.Parser('haproxy.cfg')
     configration = parser.build_configuration()
     print(configration)
Exemple #2
0
 def test_update_config_block(self):
     backend = self.configration.backend('chatleap')
     new_server = config.Server('newly1', '8.8.8.8', 1234)
     backend.add_server(new_server)
     server1 = backend.server('server1')
     server1.name = 'server2'
     backend.add_config(config.Config('conf_key_1', 'conf_key_2'))
     self.render = render.Render(self.configration)
     self.render.dumps_to('./hatest.cfg')