def _get_process_pager_kwargs(self, pager_cmd): kwargs = get_popen_kwargs_for_pager_cmd(pager_cmd) kwargs['stdin'] = PIPE env = self._environ.copy() if 'LESS' not in env: env['LESS'] = self._default_less_flags kwargs['env'] = env kwargs['universal_newlines'] = True return kwargs
def _get_process_pager_kwargs(self, pager_cmd): kwargs = get_popen_kwargs_for_pager_cmd(pager_cmd) kwargs['stdin'] = subprocess.PIPE return kwargs
def test_windows(self): kwargs = get_popen_kwargs_for_pager_cmd() self.assertEqual({'args': 'more', 'shell': True}, kwargs)
def test_non_windows_specific_pager(self): kwargs = get_popen_kwargs_for_pager_cmd('more') self.assertEqual({'args': ['more']}, kwargs)
def test_non_windows(self): kwargs = get_popen_kwargs_for_pager_cmd() self.assertEqual({'args': ['less', '-R']}, kwargs)
def test_windows_with_specific_pager(self): kwargs = get_popen_kwargs_for_pager_cmd('less -R') self.assertEqual({'args': 'less -R', 'shell': True}, kwargs)
def _get_process_pager_kwargs(self, pager_cmd): kwargs = get_popen_kwargs_for_pager_cmd(pager_cmd) kwargs['stdin'] = subprocess.PIPE return kwargs
def test_windows(self): kwargs = get_popen_kwargs_for_pager_cmd() self.assertEqual({'args': 'more', 'shell': True}, kwargs)
def test_non_windows_specific_pager(self): kwargs = get_popen_kwargs_for_pager_cmd('more') self.assertEqual({'args': ['more']}, kwargs)
def test_non_windows(self): kwargs = get_popen_kwargs_for_pager_cmd() self.assertEqual({'args': ['less', '-R']}, kwargs)
def test_windows_with_specific_pager(self): kwargs = get_popen_kwargs_for_pager_cmd('less -R') self.assertEqual({'args': 'less -R', 'shell': True}, kwargs)