<s> from pytest import raises <EOL> def test_needed_group ( ) : <EOL> from js . deform import deform_js <EOL> from kotti . fanstatic import contents_view_js <EOL> from kotti . fanstatic import NeededGroup <EOL> def NeededGroupFactory ( resources ) : <EOL> return NeededGroup ( resources ) <EOL> with raises ( ValueError ) : <EOL> NeededGroupFactory ( "<STR_LIT:foo>" ) <EOL> with raises ( ValueError ) : <EOL> NeededGroupFactory ( [ "<STR_LIT:foo>" , "<STR_LIT:bar>" ] ) <EOL> needed = NeededGroup ( [ deform_js , ] ) <EOL> assert needed . resources == [ deform_js , ] <EOL> needed . add ( contents_view_js ) <EOL> assert needed . resources == [ deform_js , contents_view_js ] <EOL> def needed_group_adder ( resource ) : <EOL> needed . add ( resource ) <EOL> with raises ( ValueError ) : <EOL> needed_group_adder ( <NUM_LIT> ) <EOL> needed = NeededGroup ( ) <EOL> assert needed . resources == [ ] </s>
