Lines Matching +full:open +full:- +full:source
18 # tr a-z A-Z is not portable, so make the ranges explicit
31 with t.open(TESTFN, 'w') as f:
33 with open(TESTFN) as f:
39 with open(TESTFN, 'w') as f:
44 with open(TESTFN2) as f:
50 with open(TESTFN, 'w') as f:
54 f = t.open(TESTFN, 'r')
63 with open(TESTFN, 'w') as f:
65 with open(TESTFN2, 'w') as f:
69 with open(TESTFN2) as f:
75 with open(TESTFN, 'w') as f:
78 f = t.open(TESTFN, 'r')
88 with t.open(TESTFN, 'w') as f:
90 with open(TESTFN) as f:
96 t.append('tr a-z A-Z', pipes.STDIN_STDOUT)
98 "<Template instance, steps=[('tr a-z A-Z', '--')]>")
108 # check calling open('r') on a pipe ending with
112 self.assertRaises(ValueError, t.open, 'bogusfile', 'r')
115 # check calling open('w') on a pipe ending with
116 # a source raises ValueError
118 t.prepend('boguscmd', pipes.SOURCE)
119 self.assertRaises(ValueError, t.open, 'bogusfile', 'w')
124 # try a non-string command
130 # shouldn't be able to append a source
131 self.assertRaises(ValueError, t.append, 'boguscmd', pipes.SOURCE)
158 # try a non-string command
162 self.assertRaises(ValueError, t.prepend, 'tr a-z A-Z', 'xx')
169 t.prepend('boguscmd', pipes.SOURCE)
170 self.assertRaises(ValueError, t.prepend, 'boguscmd', pipes.SOURCE)
190 self.assertRaises(ValueError, t.open, 'bogusfile', 'x')
194 t.append('tr a-z A-Z', pipes.STDIN_STDOUT)