<s> import unittest <EOL> from uws import UWS <EOL> class BaseTest ( unittest . TestCase ) : <EOL> def testValidateAndParsePhaseFilter ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> } <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters ( filters ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , '<STR_LIT>' ) , ( '<STR_LIT>' , '<STR_LIT>' ) ] ) <EOL> def testValidateAndParsePhaseFilterInvalidPhase ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> } <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters , <EOL> filters <EOL> ) <EOL> def testValidateAndParseAfterFilter ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters ( filters ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , '<STR_LIT>' ) ] ) <EOL> def testValidateAndParseAfterFilterInvalidDate ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters , <EOL> filters <EOL> ) <EOL> def testValidateAndParseAfterFilterTimeZone ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters ( filters ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , '<STR_LIT>' ) ] ) <EOL> def testValidateAndParseLastFilter ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters ( filters ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , <NUM_LIT:1000> ) ] ) <EOL> def testValidateAndParseLastFilterFloatValue ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters , <EOL> filters <EOL> ) <EOL> def testValidateAndParseLastFilterNegativeValue ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters , <EOL> filters <EOL> ) <EOL> def testValidateAndParseAfterLastFilter ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' <EOL> } <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters ( filters ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , <NUM_LIT:100> ) ] ) <EOL> def testValidateAndParseAfterLastPhaseFilter ( self ) : <EOL> filters = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT:100>' , <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> } <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_filters ( filters ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , '<STR_LIT>' ) , ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , ( '<STR_LIT>' , <NUM_LIT:100> ) ] ) <EOL> def testValidateAndParseWaitNegative ( self ) : <EOL> wait = '<STR_LIT>' <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_wait ( wait ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , - <NUM_LIT:1> ) ] ) <EOL> def testValidateAndParseWait ( self ) : <EOL> wait = '<STR_LIT>' <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_wait ( wait ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , <NUM_LIT:30> ) ] ) <EOL> def testValidateAndParseWaitInvalidWait ( self ) : <EOL> wait = '<STR_LIT>' <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_wait , <EOL> wait <EOL> ) <EOL> def testValidateAndParseWaitInvalidWaitNegative ( self ) : <EOL> wait = '<STR_LIT>' <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_wait , <EOL> wait <EOL> ) <EOL> def testValidateAndParseWaitPhase ( self ) : <EOL> wait = '<STR_LIT>' <EOL> phase = '<STR_LIT>' <EOL> params = UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_wait ( wait , phase ) <EOL> self . assertEqual ( params , [ ( '<STR_LIT>' , <NUM_LIT:30> ) , ( '<STR_LIT>' , '<STR_LIT>' ) ] ) <EOL> def testValidateAndParseWaitInvalidPhase ( self ) : <EOL> wait = '<STR_LIT>' <EOL> phase = '<STR_LIT>' <EOL> self . assertRaises ( <EOL> UWS . UWSError , <EOL> UWS . client . Client ( "<STR_LIT:/>" ) . _validate_and_parse_wait , <EOL> wait , phase <EOL> ) </s>
