<s> import unittest <EOL> from coaster . assets import Version , VersionedAssets , AssetNotFound <EOL> class TestAssets ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . assets = VersionedAssets ( ) <EOL> self . assets [ '<STR_LIT>' ] [ Version ( '<STR_LIT>' ) ] = '<STR_LIT>' <EOL> self . assets [ '<STR_LIT>' ] [ Version ( '<STR_LIT>' ) ] = '<STR_LIT>' <EOL> self . assets [ '<STR_LIT>' ] [ Version ( '<STR_LIT>' ) ] = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : None <EOL> } <EOL> self . assets [ '<STR_LIT>' ] [ Version ( '<STR_LIT>' ) ] = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assets [ '<STR_LIT>' ] [ Version ( '<STR_LIT>' ) ] = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> } <EOL> self . assets [ '<STR_LIT>' ] [ Version ( '<STR_LIT>' ) ] = ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_asset_unversioned ( self ) : <EOL> bundle = self . assets . require ( '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) <EOL> def test_asset_versioned ( self ) : <EOL> bundle = self . assets . require ( '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) <EOL> bundle = self . assets . require ( '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) <EOL> bundle = self . assets . require ( '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) <EOL> def test_missing_asset ( self ) : <EOL> self . assertRaises ( AssetNotFound , self . assets . require , '<STR_LIT>' ) <EOL> def test_single_requires ( self ) : <EOL> bundle = self . assets . require ( '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def test_single_requires_which_is_dict ( self ) : <EOL> bundle = self . assets . require ( '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) <EOL> def test_provides_requires ( self ) : <EOL> bundle = self . assets . require ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def test_version_copies ( self ) : <EOL> self . assertRaises ( ValueError , self . assets . require , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_version_conflict ( self ) : <EOL> self . assertRaises ( ValueError , self . assets . require , '<STR_LIT>' , '<STR_LIT>' ) <EOL> def test_blacklist ( self ) : <EOL> bundle = self . assets . require ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) <EOL> bundle = self . assets . require ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( bundle . contents , ( '<STR_LIT>' , ) ) </s>
