本文整理汇总了Python中Console.process_commands方法的典型用法代码示例。如果您正苦于以下问题:Python Console.process_commands方法的具体用法?Python Console.process_commands怎么用?Python Console.process_commands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Console
的用法示例。
在下文中一共展示了Console.process_commands方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SanityTest
# 需要导入模块: import Console [as 别名]
# 或者: from Console import process_commands [as 别名]
class SanityTest(unittest.TestCase):
def setUp(self):
# construct a test user here named dummy
self.c = Console()
self.name = "dummy"
# print(self.c)
#test new class
res = self.c.process_commands('new_class ' + self.name)
#print("res is: " + str(res))
if (not res):
print(self.c.error)
else:
if(self.c.state == CLASS_STATE):
ClassName = self.c.c.name
#print ("Class "+ ClassName +" was created.")
def tearDown(self):
shutil.rmtree('./Users/dummy')
def test_loadClass(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
def test_newUser(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
#test new student
res = self.c.process_commands('new_student ' + self.name)
self.assertEqual(res, True)
def test_loadUser(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
#test new student
res = self.c.process_commands('new_student ' + self.name)
self.assertEqual(res, True)
#test load student
res = self.c.process_commands('load_student ' + self.name)
self.assertEqual(res, True)
def test_createAnswerSheet(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
#test new student
res = self.c.process_commands('new_student ' + self.name)
self.assertEqual(res, True)
#test load student
res = self.c.process_commands('load_student ' + self.name)
self.assertEqual(res, True)
res = self.c.process_commands('answer_sheet GE30') #create answer sheet test
self.assertEqual(res, True)
def test_gradeTest(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
#test new student
res = self.c.process_commands('new_student ' + self.name)
self.assertEqual(res, True)
#test load student
res = self.c.process_commands('load_student ' + self.name)
self.assertEqual(res, True)
res = self.c.process_commands('answer_sheet GE30') #create answer sheet test
#test grade test
self.assertEqual(res, True)
res = self.c.process_commands('grade GE30.csv')
self.assertEqual(res, True)
def test_saveUser(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
#test new student
res = self.c.process_commands('new_student ' + self.name)
self.assertEqual(res, True)
#test load student
res = self.c.process_commands('load_student ' + self.name)
self.assertEqual(res, True)
res = self.c.process_commands('answer_sheet GE30') #create answer sheet test
#test grade test
self.assertEqual(res, True)
res = self.c.process_commands('grade GE30.csv')
self.assertEqual(res, True)
res = self.c.process_commands('save')
self.assertEqual(res, True)
def test_graphReport(self):
#test load class
res = self.c.process_commands('load_class ' + self.name)
self.assertEqual(res, True)
#test new student
res = self.c.process_commands('new_student ' + self.name)
self.assertEqual(res, True)
#.........这里部分代码省略.........
示例2: Console
# 需要导入模块: import Console [as 别名]
# 或者: from Console import process_commands [as 别名]
import sys
sys.path.append('Library')
from Values import *
from Console import *
c = Console()
#print c.user
#print c.state
c.process_commands("load_user Neel")
c.process_commands("reset")
c.process_commands("grade 1760.csv")
c.process_commands("grade 1860.csv")
c.process_commands("grade 1870.csv")
c.process_commands("grade 1760.csv")
c.process_commands("grade 1860.csv")
c.process_commands("grade 1870.csv")
c.process_commands("grade 1860.csv")
c.process_commands("grade 1870.csv")
c.process_commands("grade 1930.csv")
c.process_commands("grade 1930.csv")
c.process_commands("grade 1930.csv")
c.process_commands("grade 1990.csv")
c.process_commands("grade 2110.csv")
c.process_commands("grade 2170.csv")
c.process_commands("grade 2280.csv")
c.process_commands("grade 2400.csv")
c.process_commands("grade 2280.csv")
c.process_commands("grade 2370.csv")
c.process_commands("grade 2400.csv")
c.process_commands("grade 2370.csv")