]> git.phdru.name Git - sqlconvert.git/commitdiff
Add the first test
authorOleg Broytman <phd@phdru.name>
Sat, 23 Jul 2016 03:18:51 +0000 (06:18 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 23 Jul 2016 03:24:36 +0000 (06:24 +0300)
tests/test_test.py [deleted file]
tests/test_tokens.py [new file with mode: 0755]

diff --git a/tests/test_test.py b/tests/test_test.py
deleted file mode 100755 (executable)
index 422d67d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /usr/bin/env python
-
-
-import unittest
-from tests import main
-
-
-class TestFormat(unittest.TestCase):
-    def test_test(self):
-        self.assertEqual()
-
-
-if __name__ == "__main__":
-    main()
diff --git a/tests/test_tokens.py b/tests/test_tokens.py
new file mode 100755 (executable)
index 0000000..c8e786f
--- /dev/null
@@ -0,0 +1,21 @@
+#! /usr/bin/env python
+
+
+import unittest
+from sqlparse import parse
+
+from mysql2sql.process_tokens import requote_names
+from mysql2sql.print_tokens import get_tokens_str
+from tests import main
+
+
+class TestTokens(unittest.TestCase):
+    def test_requote(self):
+        parsed = parse("select * from `T`")[0]
+        requote_names(parsed)
+        query = get_tokens_str(parsed)
+        self.assertEqual(query, 'SELECT * FROM "T";\n')
+
+
+if __name__ == "__main__":
+    main()