<s> from pyvows import Vows , expect <EOL> from dopplr . solr . query import BoostQuery <EOL> from dopplr . solr . query import BoostFunctionQuery <EOL> @ Vows . batch <EOL> class TheSimpleBoostQuery ( Vows . Context ) : <EOL> def topic ( self ) : <EOL> return BoostQuery ( '<STR_LIT>' ) . get_params ( ) <EOL> def shouldContainTheBqParameter ( self , topic ) : <EOL> expect ( topic ) . to_include ( ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> @ Vows . batch <EOL> class TheBoostFunctionQuery ( Vows . Context ) : <EOL> class WithRequiredParams ( Vows . Context ) : <EOL> def topic ( self ) : <EOL> return BoostFunctionQuery ( '<STR_LIT>' ) . get_params ( ) <EOL> def shouldIncludeTheBfParameter ( self , topic ) : <EOL> expect ( topic ) . to_include ( ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> class WithAnExternalBoostingParameter ( Vows . Context ) : <EOL> def topic ( self ) : <EOL> q = BoostFunctionQuery ( '<STR_LIT>' , date = '<STR_LIT>' ) <EOL> return q . get_params ( ) <EOL> def shouldIncludeTheBfParameter ( self , topic ) : <EOL> expect ( topic ) . to_include ( ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def shouldInlcudeTheExternalParameter ( self , topic ) : <EOL> expect ( topic ) . to_include ( ( '<STR_LIT:date>' , '<STR_LIT>' ) ) <EOL> class WithAnExternalButUnreferencedParameter ( WithRequiredParams ) : <EOL> def topic ( self ) : <EOL> q = BoostFunctionQuery ( '<STR_LIT>' , date = '<STR_LIT>' ) <EOL> return q . get_params ( ) <EOL> def shouldNotIncludeTheExternalParam ( self , topic ) : <EOL> expect ( topic ) . Not . to_include ( ( '<STR_LIT:date>' , '<STR_LIT>' ) ) </s>
