~forest-bond/pshell/dev

« back to all changes in this revision

Viewing changes to tests.py

  • Committer: forest.bond at rapidrollout
  • Date: 2010-11-09 01:32:43 UTC
  • Revision ID: forest.bond@rapidrollout.com-20101109013243-swzhexzbstpds46v
Shell: Support keyword argument "strip_linefeed" to command execution
functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
    def test_echo_unicode(self):
93
93
        self.assertEqual(self.sh.execute(u'echo \u2022'), (0, u'\u2022\n'))
94
94
 
 
95
    def test_echo_no_strip_linefeed(self):
 
96
        self.assertEqual(
 
97
          self.sh.execute('echo foo', strip_linefeed = False),
 
98
          (0, u'foo\r\n'),
 
99
        )
 
100
 
95
101
    def test_false(self):
96
102
        self.assertRaises(CommandFailed, self.sh.execute, 'false')
97
103
 
166
172
        self.sh.follow_callback('echo foo', callback = l.append)
167
173
        self.assertEqual(l, ['f', 'o', 'o', '\n'])
168
174
 
 
175
    def test_follow_lines_no_strip_linefeed(self):
 
176
        self.assertEqual(
 
177
          list(self.sh.follow_lines('echo foo', strip_linefeed = False)),
 
178
          ['foo\r\n'],
 
179
        )
 
180
 
169
181
 
170
182
def main(test_names = None):
171
183
    module = __import__('tests')