Files
deb-python-cassandra-driver/tests/integration/cqlengine/operators/test_where_operators.py
Adam Holmberg 4698509727 Reloate cqlengine tests to integration tests, update imports
Not integrated with existing integration ccm operation.
There is a handful of failing cqlengine tests in the commit, that worked
before the move.
2015-02-04 11:56:19 -06:00

32 lines
1.1 KiB
Python

from unittest import TestCase
from cassandra.cqlengine.operators import *
import six
class TestWhereOperators(TestCase):
def test_symbol_lookup(self):
""" tests where symbols are looked up properly """
def check_lookup(symbol, expected):
op = BaseWhereOperator.get_operator(symbol)
self.assertEqual(op, expected)
check_lookup('EQ', EqualsOperator)
check_lookup('IN', InOperator)
check_lookup('GT', GreaterThanOperator)
check_lookup('GTE', GreaterThanOrEqualOperator)
check_lookup('LT', LessThanOperator)
check_lookup('LTE', LessThanOrEqualOperator)
def test_operator_rendering(self):
""" tests symbols are rendered properly """
self.assertEqual("=", six.text_type(EqualsOperator()))
self.assertEqual("IN", six.text_type(InOperator()))
self.assertEqual(">", six.text_type(GreaterThanOperator()))
self.assertEqual(">=", six.text_type(GreaterThanOrEqualOperator()))
self.assertEqual("<", six.text_type(LessThanOperator()))
self.assertEqual("<=", six.text_type(LessThanOrEqualOperator()))