<s> '''<STR_LIT>''' <EOL> import unittest <EOL> from certfuzz . fuzzers . insert import InsertFuzzer <EOL> import certfuzz . fuzzers . insert <EOL> import shutil <EOL> import os <EOL> from certfuzz . fuzzers import FuzzerExhaustedError <EOL> import logging <EOL> from certfuzz . test import MockSeedfile <EOL> import tempfile <EOL> certfuzz . fuzzers . insert . logger . setLevel ( logging . WARNING ) <EOL> class Test ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . sf = seedfile_obj = MockSeedfile ( ) <EOL> self . tempdir = tempfile . mkdtemp ( ) <EOL> self . outdir = outdir_base = tempfile . mkdtemp ( prefix = '<STR_LIT>' , <EOL> dir = self . tempdir ) <EOL> rng_seed = <NUM_LIT:0> <EOL> iteration = <NUM_LIT:0> <EOL> options = { } <EOL> self . args = ( seedfile_obj , outdir_base , rng_seed , iteration , options ) <EOL> def tearDown ( self ) : <EOL> shutil . rmtree ( self . tempdir , ignore_errors = True ) <EOL> def test_fuzzer_class ( self ) : <EOL> self . assertEqual ( certfuzz . fuzzers . insert . _fuzzer_class , InsertFuzzer ) <EOL> def test_fuzz_in_range ( self ) : <EOL> for x in range ( self . sf . len ) : <EOL> self . sf . tries = x <EOL> with InsertFuzzer ( * self . args ) as f : <EOL> f . _fuzz ( ) <EOL> self . assertEqual ( len ( f . fuzzed ) , self . sf . len + <NUM_LIT:1> ) <EOL> self . assertEqual ( chr ( f . fuzzed [ x + <NUM_LIT:1> ] ) , self . sf . value [ x ] ) <EOL> if x > <NUM_LIT:0> : <EOL> self . assertEqual ( chr ( f . fuzzed [ x - <NUM_LIT:1> ] ) , self . sf . value [ x - <NUM_LIT:1> ] ) <EOL> def test_fuzz_out_of_range ( self ) : <EOL> self . sf . tries = self . sf . len + <NUM_LIT:1> <EOL> with InsertFuzzer ( * self . args ) as f : <EOL> self . assertRaises ( FuzzerExhaustedError , f . _fuzz ) <EOL> def test_is_not_minimizable ( self ) : <EOL> f = InsertFuzzer ( * self . args ) <EOL> self . assertFalse ( f . is_minimizable ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
