def build_dash_config(tracker, app_token): recipe = dash.recipe('twitter_tracker', 'http://dash.fiveruns.com') recipe.counter('hits', 'Number of times the TERM is encountered', wrap=TwitterWordTrack.incr_hits) recipe.counter('misses', 'Number of times the TERM is not encountered', wrap=TwitterWordTrack.incr_misses) recipe.time('twitter_wait', 'Time spent waiting on Twitter', wrap=TwitterGetter.load) recipe.percentage('percent_hits', 'Percentage of messages that are hits', call=tracker.percent_hits) recipe.percentage('percent_misses', 'Percentage of messages that are misses', call=tracker.percent_misses) config = dash.configure(app_token=app_token) config.add_recipe('twitter_tracker') return config
def setUp(self): dash.recipes.registry.clear() self.config = dash.configure(app_token='ABC123')