예제 #1
0
 def test_bash_builder(self):
     builder = builders.BashScriptBuilder()
     builder.set_variable('var1', '13')
     builder.set_variable('var2', '2')
     builder.set_variable('foo', '33', suppress=True)
     builder.verbatim('((var3 = var1 + var2)); echo hello $var3')
     self.script_file.write(builder.finalise())
     self.script_file.close()
     self.assertTrue(
         os_ext.grep_command_output(self.script_file.name, 'hello 15'))
     self.assertFalse(
         os_ext.grep_command_output(self.script_file.name, 'foo'))
예제 #2
0
    def assertHelloMessage(self, executable=None):
        if not executable:
            executable = self.executable

        self.assertTrue(
            os_ext.grep_command_output(cmd=executable,
                                       pattern='Hello, World\!'))
        fixtures.force_remove_file(executable)
예제 #3
0
 def test_grep(self):
     assert os_ext.grep_command_output(cmd='echo hello', pattern='hello')
     assert not os_ext.grep_command_output(cmd='echo hello', pattern='foo')
예제 #4
0
 def test_grep(self):
     self.assertTrue(
         os_ext.grep_command_output(cmd='echo hello', pattern='hello'))
     self.assertFalse(
         os_ext.grep_command_output(cmd='echo hello', pattern='foo'))