<s> try : <EOL> import unittest2 as unittest <EOL> except ImportError : <EOL> import unittest <EOL> from tests . functional import test_base <EOL> @ unittest . skipIf ( test_base . get_test_server_api ( ) == <NUM_LIT:1> , <EOL> ( "<STR_LIT>" <EOL> "<STR_LIT>" ) ) <EOL> class TestActivities ( test_base . TestBase ) : <EOL> testcase_name = "<STR_LIT>" <EOL> def test_list ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _delete_all ( ) <EOL> self . _create_test_photos ( tag = False ) <EOL> photos = self . client . photos . list ( ) <EOL> activities = self . client . activities . list ( ) <EOL> self . assertEqual ( len ( activities ) , len ( photos ) ) <EOL> for activity in activities : <EOL> self . assertIn ( activity . data . id , [ photo . id for photo in photos ] ) <EOL> for photo in photos : <EOL> photo . update ( tags = self . TEST_TAG ) <EOL> def test_list_option ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _delete_all ( ) <EOL> self . _create_test_photos ( tag = False ) <EOL> photos = self . client . photos . list ( ) <EOL> photos [ <NUM_LIT:0> ] . update ( tags = photos [ <NUM_LIT:0> ] . tags ) <EOL> upload_activities = self . client . activities . list ( options = { "<STR_LIT:type>" : "<STR_LIT>" } ) <EOL> update_activities = self . client . activities . list ( options = { "<STR_LIT:type>" : "<STR_LIT>" } ) <EOL> self . assertEqual ( len ( upload_activities ) , len ( photos ) ) <EOL> self . assertEqual ( len ( update_activities ) , <NUM_LIT:1> ) <EOL> for photo in photos : <EOL> photo . update ( tags = self . TEST_TAG ) <EOL> @ unittest . expectedFailure <EOL> def test_purge ( self ) : <EOL> """<STR_LIT>""" <EOL> activities = self . client . activities . list ( ) <EOL> self . assertNotEqual ( activities , [ ] ) <EOL> self . client . activities . purge ( ) <EOL> activities = self . client . activities . list ( ) <EOL> self . assertEqual ( activities , [ ] ) <EOL> def test_view ( self ) : <EOL> """<STR_LIT>""" <EOL> activity = self . client . activities . list ( ) [ <NUM_LIT:0> ] <EOL> fields = activity . get_fields ( ) . copy ( ) <EOL> activity . view ( ) <EOL> self . assertEqual ( fields , activity . get_fields ( ) ) <EOL> activity = self . client . activity . view ( activity ) <EOL> self . assertEqual ( fields , activity . get_fields ( ) ) <EOL> activity = self . client . activity . view ( activity . id ) <EOL> self . assertEqual ( fields , activity . get_fields ( ) ) </s>
