<s> """<STR_LIT>""" <EOL> import mock <EOL> from nose . tools import * <EOL> from website . addons . base . testing . serializers import StorageAddonSerializerTestSuiteMixin <EOL> from website . addons . googledrive . model import GoogleDriveProvider <EOL> from website . addons . googledrive . tests . factories import GoogleDriveAccountFactory <EOL> from website . addons . googledrive . serializer import GoogleDriveSerializer <EOL> from tests . base import OsfTestCase <EOL> class TestGoogleDriveSerializer ( StorageAddonSerializerTestSuiteMixin , OsfTestCase ) : <EOL> addon_short_name = '<STR_LIT>' <EOL> Serializer = GoogleDriveSerializer <EOL> ExternalAccountFactory = GoogleDriveAccountFactory <EOL> client = GoogleDriveProvider <EOL> def set_provider_id ( self , pid ) : <EOL> self . node_settings . folder_id = pid <EOL> def test_serialized_node_settings_unauthorized ( self ) : <EOL> with mock . patch . object ( type ( self . node_settings ) , '<STR_LIT>' , return_value = False ) : <EOL> serialized = self . ser . serialized_node_settings <EOL> for setting in self . required_settings : <EOL> assert_in ( setting , serialized [ '<STR_LIT:result>' ] ) <EOL> def test_serialized_node_settings_authorized ( self ) : <EOL> with mock . patch . object ( type ( self . node_settings ) , '<STR_LIT>' , return_value = True ) : <EOL> serialized = self . ser . serialized_node_settings <EOL> for setting in self . required_settings : <EOL> assert_in ( setting , serialized [ '<STR_LIT:result>' ] ) <EOL> for setting in self . required_settings_authorized : <EOL> assert_in ( setting , serialized [ '<STR_LIT:result>' ] ) </s>
