<s> """<STR_LIT>""" <EOL> import unittest <EOL> from cube . filters import Filter <EOL> from cube . filters import EQ <EOL> from cube . filters import LT <EOL> from cube . filters import LE <EOL> from cube . filters import GT <EOL> from cube . filters import GE <EOL> from cube . filters import NE <EOL> from cube . filters import RE <EOL> from cube . filters import IN <EOL> from cube . filters import StartsWith <EOL> from cube . filters import EndsWith <EOL> class TestFilter ( unittest . TestCase ) : <EOL> def test_equality ( self ) : <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> f2 = EQ ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertNotEqual ( f1 , f2 ) <EOL> f2 = LT ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> f2 = LE ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> f2 = GT ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> f2 = GE ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> f2 = NE ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> f2 = RE ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , [ '<STR_LIT:t>' , '<STR_LIT:e>' , '<STR_LIT:s>' , '<STR_LIT:t>' ] ) <EOL> f2 = IN ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , [ '<STR_LIT:test>' ] ) <EOL> f2 = IN ( '<STR_LIT:name>' , [ '<STR_LIT:test>' ] ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT>' ) <EOL> f2 = StartsWith ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> f1 = Filter ( '<STR_LIT>' , '<STR_LIT:name>' , '<STR_LIT>' ) <EOL> f2 = EndsWith ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( f1 , f2 ) <EOL> def test_starts_with ( self ) : <EOL> f = StartsWith ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( "<STR_LIT:%s>" % f , '<STR_LIT>' ) <EOL> def test_ends_with ( self ) : <EOL> f = EndsWith ( '<STR_LIT:name>' , '<STR_LIT:test>' ) <EOL> self . assertEqual ( "<STR_LIT:%s>" % f , '<STR_LIT>' ) <EOL> def test_in ( self ) : <EOL> f = IN ( '<STR_LIT:name>' , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT:c>' ] ) <EOL> self . assertEqual ( "<STR_LIT:%s>" % f , '<STR_LIT>' ) </s>
