コード例 #1
0
ファイル: test_ipc.py プロジェクト: jwilk/ocrodjvu
 def _test_locale(self):
     child = ipc.Subprocess(['locale'],
         stdout=ipc.PIPE, stderr=ipc.PIPE
     )
     stdout, stderr = child.communicate()
     stdout = stdout.splitlines()
     stderr = stderr.splitlines()
     assert_equal(stderr, [])
     data = dict(line.split('=', 1) for line in stdout)
     has_lc_all = has_lc_ctype = has_lang = 0
     for key, value in data.iteritems():
         if key == 'LC_ALL':
             has_lc_all = 1
             assert_equal(value, '')
         elif key == 'LC_CTYPE':
             has_lc_ctype = 1
             assert_equal(value, 'en_US.UTF-8')
         elif key == 'LANG':
             has_lang = 1
             assert_equal(value, '')
         elif key == 'LANGUAGE':
             assert_equal(value, '')
         else:
             assert_equal(value, '"POSIX"')
     assert_true(has_lc_all)
     assert_true(has_lc_ctype)
     assert_true(has_lang)
コード例 #2
0
 def _test_locale(self):
     child = ipc.Subprocess(['locale'], stdout=ipc.PIPE, stderr=ipc.PIPE)
     stdout, stderr = child.communicate()
     stdout = stdout.splitlines()
     stderr = stderr.splitlines()
     assert_equal(stderr, [])
     data = dict(line.split('=', 1) for line in stdout)
     has_lc_all = has_lc_ctype = has_lang = 0
     for key, value in data.iteritems():
         if key == 'LC_ALL':
             has_lc_all = 1
             assert_equal(value, '')
         elif key == 'LC_CTYPE':
             has_lc_ctype = 1
             assert_equal(value, 'en_US.UTF-8')
         elif key == 'LANG':
             has_lang = 1
             assert_equal(value, '')
         elif key == 'LANGUAGE':
             assert_equal(value, '')
         else:
             assert_equal(value, '"POSIX"')
     assert_true(has_lc_all)
     assert_true(has_lc_ctype)
     assert_true(has_lang)
コード例 #3
0
ファイル: test_ipc.py プロジェクト: jwilk/ocrodjvu
 def test_sigint(self):
     ex = ipc.CalledProcessInterrupted(signal.SIGINT, 'eggs')
     assert_equal(str(ex), "Command 'eggs' was interrupted by signal SIGINT")
     assert_true(ex.by_user)
コード例 #4
0
 def test_sigint(self):
     ex = ipc.CalledProcessInterrupted(signal.SIGINT, 'eggs')
     assert_equal(str(ex),
                  "Command 'eggs' was interrupted by signal SIGINT")
     assert_true(ex.by_user)