<s> import sys <EOL> import os . path <EOL> from mock import Mock <EOL> ROOT_DIR = os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' ) <EOL> sys . path . append ( os . path . join ( ROOT_DIR , '<STR_LIT>' ) ) <EOL> import collector <EOL> from lib . modules . models import TimeSeriesTuple <EOL> class TestCollector ( object ) : <EOL> @ classmethod <EOL> def setUpAll ( cls ) : <EOL> options = Mock ( ** { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> collector . setup ( options ) <EOL> def setUp ( self ) : <EOL> self . writer = Mock ( ) <EOL> def test_collector_process_accepts_whitelisted_and_not_blacklisted_metrics ( self ) : <EOL> collector . process ( self . writer , TimeSeriesTuple ( '<STR_LIT>' , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . writer . write . called . should . be . true <EOL> def test_collector_process_ignores_not_whitelisted_metrics ( self ) : <EOL> collector . process ( self . writer , TimeSeriesTuple ( '<STR_LIT>' , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . writer . write . called . should . be . false <EOL> def test_collector_process_ignores_whitelisted_but_blacklisted_metrics ( self ) : <EOL> collector . process ( self . writer , TimeSeriesTuple ( '<STR_LIT>' , <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> self . writer . write . called . should . be . false </s>
