<s> """<STR_LIT>""" <EOL> import unittest <EOL> from nose . tools import * <EOL> from website . util import permissions <EOL> def test_expand_permissions ( ) : <EOL> result = permissions . expand_permissions ( '<STR_LIT>' ) <EOL> assert_equal ( result , [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> result2 = permissions . expand_permissions ( '<STR_LIT>' ) <EOL> assert_equal ( result2 , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> result3 = permissions . expand_permissions ( None ) <EOL> assert_equal ( result3 , [ ] ) <EOL> def test_reduce_permissions ( ) : <EOL> result = permissions . reduce_permissions ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> assert_equal ( result , '<STR_LIT>' ) <EOL> result2 = permissions . reduce_permissions ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> assert_equal ( result2 , '<STR_LIT>' ) <EOL> result3 = permissions . reduce_permissions ( [ '<STR_LIT>' ] ) <EOL> assert_equal ( result3 , '<STR_LIT>' ) <EOL> def test_reduce_permissions_with_empty_list_raises_error ( ) : <EOL> with assert_raises ( ValueError ) : <EOL> permissions . reduce_permissions ( [ ] ) <EOL> def test_reduce_permissions_with_unknown_permission_raises_error ( ) : <EOL> with assert_raises ( ValueError ) : <EOL> permissions . reduce_permissions ( [ '<STR_LIT>' ] ) <EOL> def test_default_contributor_permissions ( ) : <EOL> assert_equal ( permissions . DEFAULT_CONTRIBUTOR_PERMISSIONS , <EOL> [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
