Beispiel #1
0
 def setUp(self):
     self.user_config = mk_named_tempfile()
     self.user_config.write('[foo]\n'
                            'class = tests.config.test_init.passthrough\n')
     self.user_config.flush()
     self.system_config = mk_named_tempfile()
     self.system_config.write('[foo]\n' 'class = also invalid\n')
     self.system_config.flush()
Beispiel #2
0
 def setUp(self):
     self.user_config = mk_named_tempfile()
     self.user_config.write(
         '[foo]\n'
         'class = pkgcore.test.config.test_init.passthrough\n'
         )
     self.user_config.flush()
     self.system_config = mk_named_tempfile()
     self.system_config.write(
         '[foo]\n'
         'class = also invalid\n'
         )
     self.system_config.flush()
Beispiel #3
0
 def setup_method(self, method):
     self.valid_file = mk_named_tempfile()
     self.valid_file.write('# hi I am a comment\n'
                           'foo1=bar\n'
                           "foo2='bar'\n"
                           'foo3="bar"\n'
                           'foo4=-/:j4\n'
                           'foo5=\n'
                           'export foo6="bar"\n')
     self.valid_file.flush()
     self.sourcing_file = mk_named_tempfile()
     self.sourcing_file.write('source "%s"\n' % self.valid_file.name)
     self.sourcing_file.flush()
     self.sourcing_file2 = mk_named_tempfile()
     self.sourcing_file2.write('source "%s"\n' %
                               os.path.basename(self.valid_file.name))
     self.sourcing_file2.flush()
     self.advanced_file = mk_named_tempfile()
     self.advanced_file.write('one1=1\n'
                              'one_=$one1\n'
                              'two1=2\n'
                              'two_=${two1}\n')
     self.advanced_file.flush()
     self.env_file = mk_named_tempfile()
     self.env_file.write('imported=${external}\n')
     self.env_file.flush()
     self.escaped_file = mk_named_tempfile()
     self.escaped_file.write('end=bye\n'
                             'quoteddollar="\\${dollar}"\n'
                             'quotedexpansion="\\${${end}}"\n')
     self.escaped_file.flush()
     self.unclosed_file = mk_named_tempfile()
     self.unclosed_file.write('foo="bar')
     self.unclosed_file.flush()
Beispiel #4
0
 def setup_method(self, method):
     self.valid_file = mk_named_tempfile()
     self.valid_file.write(
         '# hi I am a comment\n'
         'foo1=bar\n'
         "foo2='bar'\n"
         'foo3="bar"\n'
         'foo4=-/:j4\n'
         'foo5=\n'
         'export foo6="bar"\n'
     )
     self.valid_file.flush()
     self.sourcing_file = mk_named_tempfile()
     self.sourcing_file.write('source "%s"\n' % self.valid_file.name)
     self.sourcing_file.flush()
     self.sourcing_file2 = mk_named_tempfile()
     self.sourcing_file2.write('source "%s"\n' % os.path.basename(self.valid_file.name))
     self.sourcing_file2.flush()
     self.advanced_file = mk_named_tempfile()
     self.advanced_file.write(
         'one1=1\n'
         'one_=$one1\n'
         'two1=2\n'
         'two_=${two1}\n'
         )
     self.advanced_file.flush()
     self.env_file = mk_named_tempfile()
     self.env_file.write(
         'imported=${external}\n'
         )
     self.env_file.flush()
     self.escaped_file = mk_named_tempfile()
     self.escaped_file.write(
         'end=bye\n'
         'quoteddollar="\\${dollar}"\n'
         'quotedexpansion="\\${${end}}"\n'
         )
     self.escaped_file.flush()
     self.unclosed_file = mk_named_tempfile()
     self.unclosed_file.write('foo="bar')
     self.unclosed_file.flush()