<s> import unittest <EOL> import copy <EOL> from nymms . suppress . suppress import SuppressionManager <EOL> from nymms . schemas import Suppression <EOL> now = <NUM_LIT:0> <EOL> SUPPRESSION_COMMON = { <EOL> '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> SUPPRESSIONS = ( <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : now + <NUM_LIT> } , <EOL> { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : now + <NUM_LIT> } ) <EOL> class MockSuppressionManager ( SuppressionManager ) : <EOL> def migrate_suppressions ( self ) : <EOL> return <EOL> def get_suppressions ( self , expire , include_disabled = False ) : <EOL> suppressions = copy . deepcopy ( SUPPRESSIONS ) <EOL> for s in suppressions : <EOL> s . update ( SUPPRESSION_COMMON ) <EOL> return ( [ Suppression ( x ) for x in suppressions ] , None ) <EOL> class TestBase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . suppression_manager = MockSuppressionManager ( <EOL> cache_ttl = <NUM_LIT> , schema_class = Suppression ) <EOL> def test_is_suppressed ( self ) : <EOL> self . assertFalse ( self . suppression_manager . is_suppressed ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( self . suppression_manager . is_suppressed ( '<STR_LIT>' ) ) <EOL> self . assertTrue ( self . suppression_manager . is_suppressed ( '<STR_LIT>' ) ) </s>
