<s> from nose . tools import eq_ <EOL> from ... dependencies import solve <EOL> from . . revision_oriented import revision <EOL> def test_comment_matches ( ) : <EOL> starts_with_t = revision . comment_matches ( r"<STR_LIT>" ) <EOL> eq_ ( solve ( starts_with_t , cache = { revision . datasources . comment : "<STR_LIT>" } ) , <EOL> True ) <EOL> eq_ ( solve ( starts_with_t , cache = { revision . datasources . comment : "<STR_LIT>" } ) , <EOL> False ) <EOL> def test_user_is_anon ( ) : <EOL> eq_ ( solve ( revision . user . is_anon , cache = { revision . datasources . user . id : <NUM_LIT:0> } ) , <EOL> True ) <EOL> eq_ ( solve ( revision . user . is_anon , cache = { revision . datasources . user . id : <NUM_LIT:1> } ) , <EOL> False ) <EOL> def test_user_text_matches ( ) : <EOL> starts_with_t = revision . user . text_matches ( r"<STR_LIT>" ) <EOL> eq_ ( solve ( starts_with_t , cache = { revision . datasources . user . text : "<STR_LIT>" } ) , <EOL> True ) <EOL> eq_ ( solve ( starts_with_t , cache = { revision . datasources . user . text : "<STR_LIT>" } ) , <EOL> False ) <EOL> def test_user_id_in_set ( ) : <EOL> is_me = revision . user . id_in_set ( { <NUM_LIT> } ) <EOL> eq_ ( solve ( is_me , cache = { revision . datasources . user . id : <NUM_LIT> } ) , <EOL> True ) <EOL> eq_ ( solve ( is_me , cache = { revision . datasources . user . id : <NUM_LIT> } ) , <EOL> False ) <EOL> def test_user_in_group ( ) : <EOL> is_bot_or_sysop = revision . user . in_group ( { '<STR_LIT>' , '<STR_LIT>' } ) <EOL> eq_ ( solve ( is_bot_or_sysop , <EOL> cache = { revision . datasources . user . info . groups : { '<STR_LIT>' } } ) , True ) <EOL> eq_ ( solve ( is_bot_or_sysop , <EOL> cache = { revision . datasources . user . info . groups : { '<STR_LIT:foo>' } } ) , False ) <EOL> def test_page_title_matches ( ) : <EOL> starts_with_t = revision . page . title_matches ( r"<STR_LIT>" ) <EOL> eq_ ( solve ( starts_with_t , cache = { revision . datasources . page . title : "<STR_LIT>" } ) , <EOL> True ) <EOL> eq_ ( solve ( starts_with_t , cache = { revision . datasources . page . title : "<STR_LIT>" } ) , <EOL> False ) <EOL> def test_page_id_in_set ( ) : <EOL> is_binary = revision . page . id_in_set ( { <NUM_LIT:0> , <NUM_LIT:1> } ) <EOL> eq_ ( solve ( is_binary , cache = { revision . datasources . page . id : <NUM_LIT:0> } ) , <EOL> True ) <EOL> eq_ ( solve ( is_binary , cache = { revision . datasources . page . id : <NUM_LIT> } ) , <EOL> False ) <EOL> def test_name_namespace_name_matches ( ) : <EOL> starts_with_t = revision . page . namespace . name_matches ( r"<STR_LIT>" ) <EOL> eq_ ( solve ( starts_with_t , <EOL> cache = { revision . datasources . page . namespace . name : "<STR_LIT>" } ) , <EOL> True ) <EOL> eq_ ( solve ( starts_with_t , <EOL> cache = { revision . datasources . page . namespace . name : "<STR_LIT>" } ) , <EOL> False ) <EOL> def test_page_namespace_id_in_set ( ) : <EOL> wikipedia_namespace = revision . page . namespace . id_in_set ( { <NUM_LIT:4> , <NUM_LIT:5> } ) <EOL> eq_ ( solve ( wikipedia_namespace , <EOL> cache = { revision . datasources . page . namespace . id : <NUM_LIT:5> } ) , <EOL> True ) <EOL> eq_ ( solve ( wikipedia_namespace , <EOL> cache = { revision . datasources . page . namespace . id : <NUM_LIT:0> } ) , <EOL> False ) </s>
