本文整理汇总了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()
#.........这里部分代码省略.........