Пример #1
0
def test_system_minimal():
    Assert(hasattr(nt, "system"))
    AreEqual(nt.system("ping localhost -n 1"), 0)
    AreEqual(nt.system('"ping localhost -n 1"'), 0)
    AreEqual(nt.system('"ping localhost -n 1'), 0)

    AreEqual(nt.system("ping"), 1)

    AreEqual(nt.system("some_command_which_is_not_available"), 1)
Пример #2
0
    def test_system_minimal(self):
        self.assertTrue(hasattr(nt, "system"))
        self.assertEqual(nt.system("ping localhost -n 1"), 0)
        self.assertEqual(nt.system('"ping localhost -n 1"'), 0)
        self.assertEqual(nt.system('"ping localhost -n 1'), 0)

        self.assertEqual(nt.system("ping"), 1)

        self.assertEqual(nt.system("some_command_which_is_not_available"), 1)
Пример #3
0
def test_system_minimal():
    Assert(hasattr(nt, "system"))
    AreEqual(nt.system("ping localhost"), 0)
    AreEqual(nt.system('"ping localhost"'), 0)
    AreEqual(nt.system('"ping localhost'), 0)
        
    AreEqual(nt.system("ping"), 1)
    
    AreEqual(nt.system("some_command_which_is_not_available"), 1)
Пример #4
0
 def test_system_minimal(self):
     self.assertTrue(hasattr(nt, "system"))
     self.assertEqual(nt.system("ping localhost -n 1"), 0)
     self.assertEqual(nt.system('"ping localhost -n 1"'), 0)
     self.assertEqual(nt.system('"ping localhost -n 1'), 0)
         
     self.assertEqual(nt.system("ping"), 1)
     
     self.assertEqual(nt.system("some_command_which_is_not_available"), 1)
Пример #5
0
 def stock_read_time_data(self, mode=1, time=1):
     code_dict = self.stock_code_dict()
     code_list = code_dict.keys()
     while 1:
         data_list = self.stock_current_price(code_list)
         system("cls")
         self.format_data_head(mode)
         for line in data_list:
             self.format_data(str(line.decode('gb2312')), mode)
         sleep(time)
def test_cp17040():
    if not is_stdlib():
        print "Will not run w/o the std library"
        return

    ec = nt.system("%s -tt -c \"import os\"" % (sys.executable))
    AreEqual(ec, 0)
Пример #7
0
def test_cp17040():
    if not is_stdlib(): 
        print "Will not run w/o the std library"
        return
        
    ec = nt.system("%s -tt -c \"import os\"" %
                   (sys.executable))
    AreEqual(ec, 0)
Пример #8
0
 def server_thread():
     global EXIT_CODE
     global HAS_EXITED
     import nt
     serverFile = path_combine(testpath.temporary_dir, "cp7451server.py")
     write_to_file(serverFile, server)
     EXIT_CODE = nt.system("%s %s" % (sys.executable, serverFile))
     HAS_EXITED = True
     try:
         nt.remove(serverFile)
     except:
         pass
Пример #9
0
 def server_thread():
     global EXIT_CODE
     global HAS_EXITED
     import nt
     serverFile = path_combine(testpath.temporary_dir, "cp7451server.py")
     write_to_file(serverFile, server)
     EXIT_CODE = nt.system("%s %s" %
                 (sys.executable, serverFile))
     HAS_EXITED = True
     try:
         nt.remove(serverFile)
     except:
         pass