Exemplo n.º 1
0
 def test_when_read_a_section_and_option_in_mysql_cnf_format_that_exist_should_return_True_in_multisection_file_and_multioption_section(
         self):
     input_ = '[bar]\nfoo = baz\n[%s]\nbar = baz\n%s\ncruft = kruft\n[foo]\nbar = baz' % \
              (self.section, self.option)
     output = True
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 2
0
 def test_when_read_a_section_and_option_that_exist_should_return_correct_value_using_no_spaces_between_option_and_value(
         self):
     input_ = '[%s]\n%s=%s' % (self.section, self.option, self.value)
     output = self.value
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 3
0
 def test_when_read_a_section_and_option_in_mysql_cnf_format_that_exist_should_return_True(
         self):
     input_ = '[%s]\n%s' % (self.section, self.option)
     output = True
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 4
0
 def test_try_to_read_a_section_that_does_not_exist_and_get_None(self):
     input_ = ''
     output = None
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 5
0
 def test_try_to_read_a_section_that_exists_but_option_dont_and_get_None(
         self):
     input_ = '[mysqld]\nsome-option = some-value'
     output = None
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 6
0
 def test_when_read_a_section_and_option_in_mysql_cnf_format_that_exist_should_return_True_in_multisection_file_and_multioption_section(self):
     input_ = '[bar]\nfoo = baz\n[%s]\nbar = baz\n%s\ncruft = kruft\n[foo]\nbar = baz' % \
              (self.section, self.option)
     output = True
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 7
0
 def do_test(self, input_, output):
     real_output = ini_parse(input_, self.section, self.option, self.value)
     self.assertEqual(output, real_output)
Exemplo n.º 8
0
 def test_when_read_a_section_and_option_in_mysql_cnf_format_that_exist_should_return_True(self):
     input_ = '[%s]\n%s' % (self.section, self.option)
     output = True
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 9
0
 def test_when_read_a_section_and_option_that_exist_should_return_correct_value_using_no_spaces_between_option_and_value(self):
     input_ = '[%s]\n%s=%s' % (self.section, self.option, self.value)
     output = self.value
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 10
0
 def test_try_to_read_a_section_that_exists_but_option_dont_and_get_None(self):
     input_ = '[mysqld]\nsome-option = some-value'
     output = None
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 11
0
 def test_try_to_read_a_section_that_does_not_exist_and_get_None(self):
     input_ = ''
     output = None
     self.assertEqual(ini_parse(input_, self.section, self.option), output)
Exemplo n.º 12
0
 def do_test(self, input_, output):
     real_output = ini_parse(input_, self.section, self.option, self.value)
     self.assertEqual(output, real_output)