<s> import uuid <EOL> import pickle <EOL> import itertools <EOL> import collections <EOL> from python_toolbox import cute_iter_tools <EOL> from python_toolbox import sequence_tools <EOL> from python_toolbox import cute_testing <EOL> from python_toolbox . nifty_collections import FrozenDict <EOL> def test ( ) : <EOL> frozen_dict = FrozenDict ( { '<STR_LIT:1>' : '<STR_LIT:a>' , '<STR_LIT:2>' : '<STR_LIT:b>' , '<STR_LIT:3>' : '<STR_LIT:c>' , } ) <EOL> assert len ( frozen_dict ) == <NUM_LIT:3> <EOL> assert set ( frozen_dict ) == set ( frozen_dict . keys ( ) ) == set ( '<STR_LIT>' ) <EOL> assert set ( frozen_dict . values ( ) ) == set ( '<STR_LIT:abc>' ) <EOL> assert set ( frozen_dict . items ( ) ) == { ( '<STR_LIT:1>' , '<STR_LIT:a>' ) , ( '<STR_LIT:2>' , '<STR_LIT:b>' ) , ( '<STR_LIT:3>' , '<STR_LIT:c>' ) , } <EOL> assert frozen_dict [ '<STR_LIT:1>' ] == '<STR_LIT:a>' <EOL> with cute_testing . RaiseAssertor ( exception_type = LookupError ) : <EOL> frozen_dict [ '<STR_LIT>' ] <EOL> assert { frozen_dict , frozen_dict } == { frozen_dict } <EOL> assert { frozen_dict : frozen_dict } == { frozen_dict : frozen_dict } <EOL> assert isinstance ( hash ( frozen_dict ) , int ) <EOL> assert frozen_dict . copy ( { '<STR_LIT>' : '<STR_LIT>' } ) == frozen_dict . copy ( meow = '<STR_LIT>' ) == FrozenDict ( { '<STR_LIT:1>' : '<STR_LIT:a>' , '<STR_LIT:2>' : '<STR_LIT:b>' , '<STR_LIT:3>' : '<STR_LIT:c>' , '<STR_LIT>' : '<STR_LIT>' , } ) <EOL> assert repr ( frozen_dict ) . startswith ( '<STR_LIT>' ) <EOL> assert pickle . loads ( pickle . dumps ( frozen_dict ) ) == frozen_dict </s>
