Exemplo n.º 1
0
    def test_read_file(self):
        # XXX-JE-ORIG, DEPRECATED: mktemp()
        with named_temporary_file() as f:
            f.write(TEST_CONFIG)
            f.close()

            d = configuration.read_configuration(f.name)
            eq_(d['outfile'], '/tmp/spam')
            eq_(d['format'], ['pretty', 'tag-counter'])
            eq_(d['tags'], ['@foo,~@bar', '@zap'])
            eq_(d['stdout_capture'], False)
            ok_('bogus' not in d)
Exemplo n.º 2
0
 def test_exec_file(self):
     # XXX-JE-ORIG, DEPRECATED: fn = tempfile.mktemp()
     # with open(fn, 'w') as f:
     #   f.write('spam = __file__\n')
     with named_temporary_file() as f:
         f.write('spam = __file__\n')
         f.close()
         g = {}
         l = {}
         runner.exec_file(f.name, g, l)
         assert '__file__' in l
         # XXX-JE-ORIG: assert 'spam' in l, '"spam" variable not set in locals (%r)' % (g, l)
         # XXX-JE-NOTE: Formatting mismatch: Too many args.
         assert 'spam' in l, '"spam" variable not set in locals (%r)' % l
         eq_(l['spam'], f.name)