Beispiel #1
0
 def test_spawnle(self):
    
     ping_cmd = os.path.join(os.environ['windir'], 'system32', 'ping')
     
     #simple sanity check
     nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "/?", {})
     #BUG - the first parameter of spawnle should be "ping"
     #nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "127.0.0.1", {})
     #BUG - even taking "ping" out, multiple args do not work
     #pid = nt.spawnle(nt.P_NOWAIT, ping_cmd ,  "-n", "15", "-w", "1000", "127.0.0.1", {})
     
     #negative cases
     self.assertRaises(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", None)
     self.assertRaises(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", {1: "xyz"})
     self.assertRaises(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", {"abc": 1})
Beispiel #2
0
    def test_spawnle(self):

        ping_cmd = os.path.join(os.environ['windir'], 'system32', 'ping')

        #simple sanity check
        nt.spawnle(nt.P_WAIT, ping_cmd, "ping", "/?", {})
        #BUG - the first parameter of spawnle should be "ping"
        #nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "127.0.0.1", {})
        #BUG - even taking "ping" out, multiple args do not work
        #pid = nt.spawnle(nt.P_NOWAIT, ping_cmd ,  "-n", "15", "-w", "1000", "127.0.0.1", {})

        #negative cases
        self.assertRaises(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd, "ping",
                          "/?", None)
        self.assertRaises(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd, "ping",
                          "/?", {1: "xyz"})
        self.assertRaises(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd, "ping",
                          "/?", {"abc": 1})
Beispiel #3
0
def test_spawnle():
    '''
    '''
    #BUG?
    #CPython nt has no spawnle function
    if is_cli == False:
        return
    
    ping_cmd = get_environ_variable("windir") + "\system32\ping"
    
    #simple sanity check
    nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "/?", {})
    #BUG - the first parameter of spawnle should be "ping"
    #nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "127.0.0.1", {})
    #BUG - even taking "ping" out, multiple args do not work
    #pid = nt.spawnle(nt.P_NOWAIT, ping_cmd ,  "-n", "15", "-w", "1000", "127.0.0.1", {})
    
    #negative cases
    AssertError(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", None)
    AssertError(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", {1: "xyz"})
    AssertError(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", {"abc": 1})
Beispiel #4
0
def test_spawnle():
    '''
    '''
    #BUG?
    #CPython nt has no spawnle function
    if is_cli == False:
        return
    
    ping_cmd = get_environ_variable("windir") + "\system32\ping"
    
    #simple sanity check
    nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "/?", {})
    #BUG - the first parameter of spawnle should be "ping"
    #nt.spawnle(nt.P_WAIT, ping_cmd , "ping", "127.0.0.1", {})
    #BUG - even taking "ping" out, multiple args do not work
    #pid = nt.spawnle(nt.P_NOWAIT, ping_cmd ,  "-n", "15", "-w", "1000", "127.0.0.1", {})
    
    #negative cases
    AssertError(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", None)
    AssertError(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", {1: "xyz"})
    AssertError(TypeError, nt.spawnle, nt.P_WAIT, ping_cmd , "ping", "/?", {"abc": 1})