<s> """<STR_LIT>""" <EOL> import unittest <EOL> from raco . fakedb import FakeDatabase <EOL> from raco . scheme import Scheme <EOL> from raco . myrial . myrial_test import MyrialTestCase <EOL> from raco . expression import TypeSafetyViolation <EOL> from collections import Counter <EOL> from raco import types <EOL> class TypeTests ( MyrialTestCase ) : <EOL> schema = Scheme ( <EOL> [ ( "<STR_LIT>" , types . LONG_TYPE ) , <EOL> ( "<STR_LIT>" , types . INT_TYPE ) , <EOL> ( "<STR_LIT>" , types . STRING_TYPE ) , <EOL> ( "<STR_LIT>" , types . DOUBLE_TYPE ) , <EOL> ( "<STR_LIT>" , types . BOOLEAN_TYPE ) , <EOL> ( "<STR_LIT>" , types . DATETIME_TYPE ) ] ) <EOL> def setUp ( self ) : <EOL> super ( TypeTests , self ) . setUp ( ) <EOL> self . db . ingest ( "<STR_LIT>" , Counter ( ) , TypeTests . schema ) <EOL> def test_noop ( self ) : <EOL> query = """<STR_LIT>""" <EOL> self . check_scheme ( query , TypeTests . schema ) <EOL> def test_invalid_eq1 ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_eq2 ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_ge ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_lt ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_and ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_or_both_bad ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_or_right_bad ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_or_left_bad ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_not ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_plus ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_times ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_divide ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_divide ( self ) : <EOL> query = """<STR_LIT>""" <EOL> schema = Scheme ( [ ( '<STR_LIT:y>' , types . DOUBLE_TYPE ) ] ) <EOL> self . check_scheme ( query , schema ) <EOL> def test_idivide ( self ) : <EOL> query = """<STR_LIT>""" <EOL> schema = Scheme ( [ ( '<STR_LIT:y>' , types . LONG_TYPE ) ] ) <EOL> self . check_scheme ( query , schema ) <EOL> def test_mod ( self ) : <EOL> query = """<STR_LIT>""" <EOL> schema = Scheme ( [ ( '<STR_LIT:y>' , types . LONG_TYPE ) ] ) <EOL> self . check_scheme ( query , schema ) <EOL> def test_invalid_mod ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_neg ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_case1 ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_case2 ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_cos ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_floor ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_ceil ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_tan ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_pow ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_substr ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_len ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_greater ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_lesser ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_sum_compare ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_max_compare ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_avg ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) <EOL> def test_invalid_stdev ( self ) : <EOL> query = """<STR_LIT>""" <EOL> with self . assertRaises ( TypeSafetyViolation ) : <EOL> self . check_scheme ( query , None ) </s>
