<s> import unittest <EOL> from prawtools . stats import SubRedditStats <EOL> class StatsTest ( unittest . TestCase ) : <EOL> def test_recent ( self ) : <EOL> srs = SubRedditStats ( '<STR_LIT>' , None , None ) <EOL> self . assertTrue ( <EOL> srs . fetch_recent_submissions ( max_duration = <NUM_LIT:7> , <EOL> after = None , <EOL> exclude_self = False , <EOL> exclude_link = False ) ) <EOL> self . assertTrue ( len ( srs . submissions ) > <NUM_LIT:1> ) <EOL> prev = <NUM_LIT:0> <EOL> for submission in srs . submissions : <EOL> self . assertTrue ( prev < submission . created_utc ) <EOL> prev = submission . created_utc <EOL> def test_recent_type_eror ( self ) : <EOL> srs = SubRedditStats ( '<STR_LIT>' , None , None ) <EOL> self . assertRaises ( TypeError , srs . fetch_recent_submissions , <EOL> exclude_self = True , exclude_link = True , after = None , <EOL> max_duration = <NUM_LIT:7> ) <EOL> def test_top ( self ) : <EOL> srs = SubRedditStats ( '<STR_LIT>' , None , None ) <EOL> self . assertTrue ( <EOL> srs . fetch_top_submissions ( '<STR_LIT>' , None , None ) ) <EOL> self . assertTrue ( len ( srs . submissions ) > <NUM_LIT:1> ) <EOL> prev = <NUM_LIT:0> <EOL> for submission in srs . submissions : <EOL> self . assertTrue ( prev < submission . created_utc ) <EOL> prev = submission . created_utc <EOL> def test_top_type_eror ( self ) : <EOL> srs = SubRedditStats ( '<STR_LIT>' , None , None ) <EOL> self . assertRaises ( TypeError , srs . fetch_top_submissions , <EOL> exclude_self = True , exclude_link = True ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
