-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added unit tests to handle wildcard query use case
- Loading branch information
Bhargava Vadlamani
committed
May 24, 2019
1 parent
b440ceb
commit 9a36709
Showing
4 changed files
with
45 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from sqlalchemy_drill.sadrill import DrillIdentifierPreparer,DrillDialect_sadrill | ||
import unittest | ||
|
||
# | ||
class FormatConvertorTest(unittest.TestCase): | ||
|
||
def test_file_without_extension(self): | ||
expected_result = DrillIdentifierPreparer.format_drill_table("s3.root.test_table_csv") | ||
self.assertEqual("""`s3`.`root`.`test_table_csv`""" , expected_result) | ||
|
||
def test_file_with_extension(self): | ||
expected_result = DrillIdentifierPreparer.format_drill_table("s3.root.test_table.csv") | ||
self.assertEqual("""`s3`.`root`.`test_table.csv`""" , expected_result) | ||
|
||
def test_non_file_type_extension(self): | ||
expected_result = DrillIdentifierPreparer.format_drill_table("customers.orders",False) | ||
self.assertEqual("""`customers`.`orders`""" , expected_result) | ||
|
||
def test_wildcard_file_extension(self): | ||
expected_result = DrillIdentifierPreparer.format_drill_table("select * from namespace.schema.folder/*.csv",True) | ||
self.assertEqual("""`select * from namespace`.`schema`.`folder/*.csv`""",expected_result) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters