summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2014-11-23 16:54:14 -0500
committerHarel Ben-Attia <harelba@gmail.com>2014-11-23 16:54:14 -0500
commitd90c3927cd637472b4c5025c45571f5700ea8810 (patch)
treed3d97ffb8739ee5a2f36ca13cb6e7a9bc95ca5da
parentd04a24c8715dc2af32f623c72ee7dd69c2ede198 (diff)
modified non existent file error msg + fixed response bug in table_structure when there are errors
-rw-r--r--.gitignore1
-rwxr-xr-xbin/q4
-rwxr-xr-xtest/test-suite11
3 files changed, 14 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 4979711..5c6d010 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
build
q.spec
q.1
+*.pyc
diff --git a/bin/q b/bin/q
index 5f9520b..e9c8a6c 100755
--- a/bin/q
+++ b/bin/q
@@ -680,7 +680,7 @@ class TableCreator(object):
# If there are no files to go over,
if len(materialized_file_list) == 0:
raise FileNotFoundException(
- "No files have been found for '%s'" % self.filenames_str)
+ "No files matching '%s' have been found" % self.filenames_str)
return materialized_file_list
@@ -1129,7 +1129,7 @@ class QTextAsData(object):
warnings = []
error = None
data_loads = []
- table_structures = None
+ table_structures = []
db_results_obj = None
diff --git a/test/test-suite b/test/test-suite
index d627041..ac54971 100755
--- a/test/test-suite
+++ b/test/test-suite
@@ -1250,6 +1250,17 @@ class BasicTests(AbstractQTestCase):
self.cleanup(tmp_data_file)
+ def test_nonexistent_file(self):
+ cmd = '../bin/q "select * from non-existent-file"'
+
+ retcode, o, e = run_command(cmd)
+
+ self.assertNotEquals(retcode,0)
+ self.assertEquals(len(o),0)
+ self.assertEquals(len(e),1)
+
+ self.assertEquals(e[0],"No files matching 'non-existent-file' have been found")
+
class ParsingModeTests(AbstractQTestCase):
def test_strict_mode_column_count_mismatch_error(self):