From: Oleg Broytman Date: Sat, 23 Jul 2016 03:18:51 +0000 (+0300) Subject: Add the first test X-Git-Tag: 0.0.1~56 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=88eedec9d5e7c7598c01a9316b49f90d7e62eee4;p=sqlconvert.git Add the first test --- diff --git a/tests/test_test.py b/tests/test_test.py deleted file mode 100755 index 422d67d..0000000 --- a/tests/test_test.py +++ /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 index 0000000..c8e786f --- /dev/null +++ b/tests/test_tokens.py @@ -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()