Example #1
0
    def test_initial_comments(self):
        result = config._postprocess('[__COMMENTS__]\n'
                                     '__SEMICOLON0__ = foobar')
        self.assertEqual(result, '; foobar')

        result = config._postprocess('[__COMMENTS__]\n' '__HASH0__ = foobar')
        self.assertEqual(result, '# foobar')

        result = config._postprocess('[__COMMENTS__]\n'
                                     '__SEMICOLON0__ = foo\n'
                                     '__HASH1__ = bar')
        self.assertEqual(result, '; foo\n# bar')
Example #2
0
    def test_initial_comments(self):
        result = config._postprocess('[__COMMENTS__]\n'
                                     '__SEMICOLON0__ = foobar')
        self.assertEqual(result, '; foobar')

        result = config._postprocess('[__COMMENTS__]\n'
                                     '__HASH0__ = foobar')
        self.assertEqual(result, '# foobar')

        result = config._postprocess('[__COMMENTS__]\n'
                                     '__SEMICOLON0__ = foo\n'
                                     '__HASH1__ = bar')
        self.assertEqual(result, '; foo\n# bar')
Example #3
0
 def test_conversion(self):
     result = config._postprocess(PROCESSED_CONFIG)
     self.assertEqual(result, INPUT_CONFIG)
Example #4
0
 def test_section_extra_text_inline_semicolon(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  '__SECTION0__ = foobar\n'
                                  '__INLINE1__ = baz')
     self.assertEqual(result, '[section] foobar ; baz')
Example #5
0
 def test_section_extra_text(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  '__SECTION0__ = foobar')
     self.assertEqual(result, '[section] foobar')
Example #6
0
 def test_inline_semicolon_comment(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  'foo = bar\n'
                                  '__INLINE0__ = baz')
     self.assertEqual(result, '[section]\nfoo = bar ; baz')
Example #7
0
 def test_initial_comment_inline_handling(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '__SEMICOLON0__ = foo\n'
                                  '__INLINE1__ = bar\n'
                                  '__INLINE2__ = baz')
     self.assertEqual(result, '; foo ; bar ; baz')
Example #8
0
 def test_plain_section(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  'foo = bar')
     self.assertEqual(result, '[section]\nfoo = bar')
Example #9
0
 def test_empty_config(self):
     result = config._postprocess('[__COMMENTS__]')
     self.assertEqual(result, '')
Example #10
0
 def test_conversion(self):
     result = config._postprocess(PROCESSED_CONFIG)
     self.assertEqual(result, INPUT_CONFIG)
Example #11
0
 def test_section_extra_text_inline_semicolon(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  '__SECTION0__ = foobar\n'
                                  '__INLINE1__ = baz')
     self.assertEqual(result, '[section] foobar ; baz')
Example #12
0
 def test_section_extra_text(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  '__SECTION0__ = foobar')
     self.assertEqual(result, '[section] foobar')
Example #13
0
 def test_inline_semicolon_comment(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  'foo = bar\n'
                                  '__INLINE0__ = baz')
     self.assertEqual(result, '[section]\nfoo = bar ; baz')
Example #14
0
 def test_initial_comment_inline_handling(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '__SEMICOLON0__ = foo\n'
                                  '__INLINE1__ = bar\n'
                                  '__INLINE2__ = baz')
     self.assertEqual(result, '; foo ; bar ; baz')
Example #15
0
 def test_plain_section(self):
     result = config._postprocess('[__COMMENTS__]\n'
                                  '[section]\n'
                                  'foo = bar')
     self.assertEqual(result, '[section]\nfoo = bar')
Example #16
0
 def test_empty_config(self):
     result = config._postprocess('[__COMMENTS__]')
     self.assertEqual(result, '')