Ejemplo n.º 1
0
def test_config_section_contextless():
    config = ConfigClient()
    test_section_1 = generate_uuid()
    test_section_2 = generate_uuid()
    config.set_config_option(test_section_1, 'a', 'b')
    config.set_config_option(test_section_2, 'c', 'd')

    value = config.get_config(None, None)

    assert isinstance(value, dict)
    assert list(value.keys()) == [test_section_1, test_section_2]
Ejemplo n.º 2
0
 def setUp(self):
     self.c = ConfigClient()
     self.test_section_1 = str(generate_uuid())
     self.test_section_2 = str(generate_uuid())
     self.test_option_s = 'string'
     self.test_option_b = 'bool'
     self.test_option_i = 'int'
     self.test_option_f = 'float'
     self.test_option_sv = 'iddqd'
     self.test_option_bv = 'True'
     self.test_option_iv = '543210'
     self.test_option_fv = '3.1415'
     self.c.set_config_option(self.test_section_1, self.test_option_s, self.test_option_sv)
     self.c.set_config_option(self.test_section_1, self.test_option_b, self.test_option_bv)
     self.c.set_config_option(self.test_section_2, self.test_option_i, self.test_option_iv)
     self.c.set_config_option(self.test_section_2, self.test_option_f, self.test_option_fv)