summaryrefslogtreecommitdiff
path: root/tests/common
diff options
context:
space:
mode:
authorMichaël Ball <michael.ball@gmail.com>2016-02-07 15:28:56 +0000
committerMichaël Ball <michael.ball@gmail.com>2016-07-15 07:15:13 +0100
commitcaa1c3ccdf94ee20140b3964aab0ad3058e03699 (patch)
tree12de8657e4fe4533a62c8693cb8cdaa90a74e27f /tests/common
parentea4391ba43fab82b8f1fbf2f9ab939e60d5e0bc2 (diff)
Create test framework
Diffstat (limited to 'tests/common')
-rw-r--r--tests/common/utils_test.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/common/utils_test.py b/tests/common/utils_test.py
new file mode 100644
index 0000000..9cf1c55
--- /dev/null
+++ b/tests/common/utils_test.py
@@ -0,0 +1,14 @@
+from common import utils
+
+
+def test_make_where_clause():
+ params_with_between = {"column": "BETWEEN"}
+
+ assert utils.make_where_clause(params_with_between) == "WHERE column "\
+ "BETWEEN :column1 AND :column2"
+
+
+def test_update_clause_from_dict():
+ test_data = {"name": "Flaf"}
+
+ assert utils.update_clause_from_dict(test_data) == "SET name = :name"