本文整理匯總了Python中Interpreter.do_load_from_file方法的典型用法代碼示例。如果您正苦於以下問題:Python Interpreter.do_load_from_file方法的具體用法?Python Interpreter.do_load_from_file怎麽用?Python Interpreter.do_load_from_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Interpreter
的用法示例。
在下文中一共展示了Interpreter.do_load_from_file方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: MainTests
# 需要導入模塊: import Interpreter [as 別名]
# 或者: from Interpreter import do_load_from_file [as 別名]
class MainTests(unittest.TestCase):
def setUp(self):
self.interpreter = Interpreter()
def tearDown(self):
# be executed after each test case
print('down')
def test_01(self):
self.assertIsInstance(self.interpreter, Interpreter)
def test_02(self):
self.assertNotIsInstance(self.interpreter.graphs, Graph)
def test_03(self):
self.assertIsNot(self.interpreter.graphs, type(tuple(self.interpreter.graphs)))
# Check to see if functions exists by calling them
def test_04(self):
try:
self.interpreter.do_load_from_file("")
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
# This test should fail due to issues with "args" interpreter
@unittest.expectedFailure
def test_05(self):
try:
self.interpreter.do_display_data()
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_06(self):
try:
self.interpreter.do_display_data("")
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_07(self):
try:
self.interpreter.do_display_data("")
self.assertTrue(True)
except AttributeError:
self.assertFalse(False)
def test_08(self):
try:
self.interpreter.do_backup_database("file.txt")
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_09(self):
try:
self.interpreter.do_get_data("select * from employee")
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_10(self):
try:
self.interpreter.database.setup()
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_11(self):
try:
self.interpreter.database.display_data()
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_12(self):
try:
self.interpreter.database.commit()
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_13(self):
try:
self.interpreter.database.write_to_database("")
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_14(self):
try:
self.interpreter.database.backup_database()
self.assertTrue(True)
except AttributeError:
self.assertTrue(False)
def test_15(self):
try:
self.interpreter.database.commit()
#.........這裏部分代碼省略.........