<s> """<STR_LIT>""" <EOL> from unittest import TestCase <EOL> from nose . tools import raises <EOL> from yql import YQLQuery <EOL> class YQLQueryTest ( TestCase ) : <EOL> @ raises ( ValueError ) <EOL> def test_empty_args_raises_valueerror ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> params = { } <EOL> query . validate ( params ) <EOL> @ raises ( ValueError ) <EOL> def test_incorrect_args_raises_valueerror ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> params = { '<STR_LIT:test>' : '<STR_LIT>' } <EOL> query . validate ( params ) <EOL> @ raises ( ValueError ) <EOL> def test_params_raises_when_not_dict ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> params = [ '<STR_LIT:test>' ] <EOL> query . validate ( params ) <EOL> @ raises ( ValueError ) <EOL> def test_unecessary_args_raises_valueerror ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> params = { '<STR_LIT:test>' : '<STR_LIT>' } <EOL> query . validate ( params ) <EOL> @ raises ( ValueError ) <EOL> def test_incorrect_type_raises_valueerror ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> params = ( '<STR_LIT>' ) <EOL> query . validate ( params ) <EOL> @ raises ( ValueError ) <EOL> def test_requires_substitutions ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> query . validate ( ) <EOL> def test_placeholder_regex_one ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> placeholders = query . get_placeholder_keys ( ) <EOL> self . assertEqual ( placeholders , [ ] ) <EOL> def test_placeholder_regex_two ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> placeholders = query . get_placeholder_keys ( ) <EOL> self . assertEqual ( placeholders , [ '<STR_LIT:foo>' ] ) <EOL> def test_placeholder_regex_three ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> placeholders = query . get_placeholder_keys ( ) <EOL> self . assertEqual ( placeholders , [ '<STR_LIT:foo>' , '<STR_LIT:bar>' ] ) <EOL> def test_placeholder_regex_four ( self ) : <EOL> query = YQLQuery ( "<STR_LIT>" ) <EOL> placeholders = query . get_placeholder_keys ( ) <EOL> self . assertEqual ( placeholders , [ '<STR_LIT:foo>' ] ) <EOL> def test_placeholder_regex_five ( self ) : <EOL> query = YQLQuery ( """<STR_LIT>""" ) <EOL> placeholders = query . get_placeholder_keys ( ) <EOL> self . assertEqual ( placeholders , [ '<STR_LIT:foo>' ] ) </s>
