From 88eedec9d5e7c7598c01a9316b49f90d7e62eee4 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 23 Jul 2016 06:18:51 +0300 Subject: [PATCH] Add the first test --- tests/test_test.py | 14 -------------- tests/test_tokens.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 14 deletions(-) delete mode 100755 tests/test_test.py create mode 100755 tests/test_tokens.py 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() -- 2.39.5