Test load local infile when the file does not exist
(self)
| 9 | |
| 10 | class 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""" |