<s> import uuid <EOL> import os <EOL> import tweepy <EOL> from zope import interface <EOL> from twisted . internet import defer , utils <EOL> from twisted . web import client <EOL> from piped . plugins . status_testing import statustest , processors <EOL> from piped import processing , util <EOL> class TestTwitterProcessor ( processors . StatusTestProcessor ) : <EOL> interface . classProvides ( processing . IProcessor ) <EOL> name = '<STR_LIT>' <EOL> class TestTwitter ( statustest . StatusTestCase ) : <EOL> timeout = <NUM_LIT:10> <EOL> def setUp ( self , auth ) : <EOL> self . auth = auth <EOL> self . oauth_override = [ '<STR_LIT>' , '<STR_LIT>' % self . auth ] <EOL> self . oauth_override += [ '<STR_LIT>' , '<STR_LIT>' % self . auth [ '<STR_LIT>' ] ] <EOL> @ defer . inlineCallbacks <EOL> def statustest_status_updated ( self ) : <EOL> unique_status = uuid . uuid4 ( ) . hex <EOL> generate_override = [ '<STR_LIT>' , '<STR_LIT>' % unique_status ] <EOL> yield utils . getProcessOutput ( '<STR_LIT>' , [ '<STR_LIT>' , '<STR_LIT>' ] + self . oauth_override + generate_override , env = os . environ ) <EOL> yield util . wait ( <NUM_LIT:1> ) <EOL> api = tweepy . API ( ) <EOL> user = api . get_user ( self . auth [ '<STR_LIT:username>' ] ) <EOL> user = api . get_user ( self . auth [ '<STR_LIT:username>' ] ) <EOL> self . assertEquals ( user . status . text , unique_status ) <EOL> def configure ( self , runtime_environment ) : <EOL> self . auth = runtime_environment . get_configuration_value ( '<STR_LIT>' , None ) <EOL> def get_namespace ( self , baton ) : <EOL> return dict ( auth = self . auth ) </s>
