File: test_noninteractive.py

package info (click to toggle)
rpy 1.0.3-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 636 kB
  • ctags: 774
  • sloc: ansic: 2,139; python: 1,591; makefile: 119; sh: 73
file content (21 lines) | stat: -rw-r--r-- 555 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from __future__ import nested_scopes

import unittest
import sys
sys.path.insert(1, "..")
import os.path, time
from rpy_tools import getstatusoutput


class NonInteractiveTestCase(unittest.TestCase):

    def testNonInteractiveErrors(self):
        """
        Ensure that when rpy is used non-interactively, errors don't cause abort.
        """

        flag, message = getstatusoutput("echo 'import rpy; rpy.r(\"foobar()\")' | python")
        assert( message.find('Execution halted') ==  -1 )
         
if __name__ == '__main__':
     unittest.main()