Exemplo n.º 1
0
    def test_Executable(self):
        from roslaunch.core import Executable, PHASE_SETUP, PHASE_RUN, PHASE_TEARDOWN

        e = Executable('ls', ['-alF'])
        self.assertEquals('ls', e.command)
        self.assertEquals(['-alF'], e.args)
        self.assertEquals(PHASE_RUN, e.phase)
        self.assertEquals('ls -alF', str(e))
        self.assertEquals('ls -alF', repr(e))        

        e = Executable('ls', ['-alF', 'b*'], PHASE_TEARDOWN)
        self.assertEquals('ls', e.command)
        self.assertEquals(['-alF', 'b*'], e.args)
        self.assertEquals(PHASE_TEARDOWN, e.phase)
        self.assertEquals('ls -alF b*', str(e))
        self.assertEquals('ls -alF b*', repr(e))        
Exemplo n.º 2
0
def test_Executable():
    from roslaunch.core import Executable, PHASE_SETUP
    e = Executable('cmd', ('arg1', 'arg2'), PHASE_SETUP)
    assert e.command == 'cmd'
    assert e.args == ('arg1', 'arg2')
    assert e.phase == PHASE_SETUP
    assert 'cmd' in str(e)
    assert 'arg2' in str(e)
    assert 'cmd' in repr(e)
    assert 'arg2' in repr(e)