Ejemplo n.º 1
0
 def test_set_directive_does_not_clobber_suffix_key(self):
     lines = installutils.set_directive_lines(False,
                                              '=',
                                              'foo',
                                              '3',
                                              EXAMPLE_CONFIG,
                                              comment="#")
     assert list(lines) == ['foo=3\n', 'foobar=2\n']
Ejemplo n.º 2
0
 def test_remove_directive(self):
     lines = installutils.set_directive_lines(False,
                                              ' ',
                                              'foo',
                                              None,
                                              WHITESPACE_CONFIG,
                                              comment="#")
     assert list(lines) == ['foobar\t2\n']
Ejemplo n.º 3
0
 def test_add_directive(self):
     lines = installutils.set_directive_lines(False,
                                              '=',
                                              'baz',
                                              '4',
                                              EXAMPLE_CONFIG,
                                              comment="#")
     assert list(lines) == ['foo=1\n', 'foobar=2\n', 'baz=4\n']
Ejemplo n.º 4
0
 def test_remove_directive(self):
     lines = installutils.set_directive_lines(False,
                                              '=',
                                              'foo',
                                              None,
                                              EXAMPLE_CONFIG,
                                              comment="#")
     assert list(lines) == ['foobar=2\n']
Ejemplo n.º 5
0
 def test_set_directive_does_not_clobber_suffix_key(self):
     lines = installutils.set_directive_lines(
         False, '=', 'foo', '3', EXAMPLE_CONFIG, comment="#")
     assert list(lines) == ['foo=3\n', 'foobar=2\n']
Ejemplo n.º 6
0
 def test_add_directive(self):
     lines = installutils.set_directive_lines(
         False, '=', 'baz', '4', EXAMPLE_CONFIG, comment="#")
     assert list(lines) == ['foo=1\n', 'foobar=2\n', 'baz=4\n']
Ejemplo n.º 7
0
 def test_remove_directive(self):
     lines = installutils.set_directive_lines(
         False, '=', 'foo', None, EXAMPLE_CONFIG, comment="#")
     assert list(lines) == ['foobar=2\n']