MCPcopy
hub / github.com/PyMySQL/PyMySQL / test_no_file

Method test_no_file

pymysql/tests/test_load_local.py:11–27  ·  view source on GitHub ↗

Test load local infile when the file does not exist

(self)

Source from the content-addressed store, hash-verified

9
10class TestLoadLocal(base.PyMySQLTestCase):
11 def test_no_file(self):
12 """Test load local infile when the file does not exist"""
13 conn = self.connect()
14 c = conn.cursor()
15 c.execute("CREATE TABLE test_load_local (a INTEGER, b INTEGER)")
16 try:
17 self.assertRaises(
18 OperationalError,
19 c.execute,
20 (
21 "LOAD DATA LOCAL INFILE 'no_data.txt' INTO TABLE "
22 "test_load_local fields terminated by ','"
23 ),
24 )
25 finally:
26 c.execute("DROP TABLE test_load_local")
27 c.close()
28
29 def test_load_file(self):
30 """Test load local infile with a valid file"""

Callers

nothing calls this directly

Calls 4

cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected