Ejemplo n.º 1
0
    def test_get_user(self):
        body = ('[{"Name":"username",'
                '"ServerId":"1efa5077976bfa92bc71652404f646ec",'
                '"Id":"2ec276a2642e54a19b612b9418a8bd3b","HasPassword":true,'
                '"HasConfiguredPassword":true,'
                '"HasConfiguredEasyPassword":false,'
                '"LastLoginDate":"2015-11-09T08:35:03.6357440Z",'
                '"LastActivityDate":"2015-11-09T08:42:39.3693220Z",'
                '"Configuration":{"AudioLanguagePreference":"",'
                '"PlayDefaultAudioTrack":true,"SubtitleLanguagePreference":"",'
                '"DisplayMissingEpisodes":false,'
                '"DisplayUnairedEpisodes":false,'
                '"GroupMoviesIntoBoxSets":false,'
                '"DisplayChannelsWithinViews":[],'
                '"ExcludeFoldersFromGrouping":[],"GroupedFolders":[],'
                '"SubtitleMode":"Default","DisplayCollectionsView":true,'
                '"DisplayFoldersView":false,"EnableLocalPassword":false,'
                '"OrderedViews":[],"IncludeTrailersInSuggestions":true,'
                '"EnableCinemaMode":true,"LatestItemsExcludes":[],'
                '"PlainFolderViews":[],"HidePlayedInLatest":true,'
                '"DisplayChannelsInline":false},'
                '"Policy":{"IsAdministrator":true,"IsHidden":false,'
                '"IsDisabled":false,"BlockedTags":[],'
                '"EnableUserPreferenceAccess":true,"AccessSchedules":[],'
                '"BlockUnratedItems":[],'
                '"EnableRemoteControlOfOtherUsers":false,'
                '"EnableSharedDeviceControl":true,'
                '"EnableLiveTvManagement":true,"EnableLiveTvAccess":true,'
                '"EnableMediaPlayback":true,'
                '"EnableAudioPlaybackTranscoding":true,'
                '"EnableVideoPlaybackTranscoding":true,'
                '"EnableContentDeletion":false,'
                '"EnableContentDownloading":true,'
                '"EnableSync":true,"EnableSyncTranscoding":true,'
                '"EnabledDevices":[],"EnableAllDevices":true,'
                '"EnabledChannels":[],"EnableAllChannels":true,'
                '"EnabledFolders":[],"EnableAllFolders":true,'
                '"InvalidLoginAttemptCount":0,"EnablePublicSharing":true}}]')

        responses.add(responses.GET,
                      'http://localhost:8096/Users/Public',
                      body=body,
                      status=200,
                      content_type='application/json')

        response = embyupdate.get_user('http://localhost', 8096, 'username')

        self.assertEqual(response[0]['Id'],
                         '2ec276a2642e54a19b612b9418a8bd3b')

        self.assertEqual(response[0]['Name'],
                         'username')
Ejemplo n.º 2
0
    def test_get_user(self):
        body = ('[{"Name":"username",'
                '"ServerId":"1efa5077976bfa92bc71652404f646ec",'
                '"Id":"2ec276a2642e54a19b612b9418a8bd3b","HasPassword":true,'
                '"HasConfiguredPassword":true,'
                '"HasConfiguredEasyPassword":false,'
                '"LastLoginDate":"2015-11-09T08:35:03.6357440Z",'
                '"LastActivityDate":"2015-11-09T08:42:39.3693220Z",'
                '"Configuration":{"AudioLanguagePreference":"",'
                '"PlayDefaultAudioTrack":true,"SubtitleLanguagePreference":"",'
                '"DisplayMissingEpisodes":false,'
                '"DisplayUnairedEpisodes":false,'
                '"GroupMoviesIntoBoxSets":false,'
                '"DisplayChannelsWithinViews":[],'
                '"ExcludeFoldersFromGrouping":[],"GroupedFolders":[],'
                '"SubtitleMode":"Default","DisplayCollectionsView":true,'
                '"DisplayFoldersView":false,"EnableLocalPassword":false,'
                '"OrderedViews":[],"IncludeTrailersInSuggestions":true,'
                '"EnableCinemaMode":true,"LatestItemsExcludes":[],'
                '"PlainFolderViews":[],"HidePlayedInLatest":true,'
                '"DisplayChannelsInline":false},'
                '"Policy":{"IsAdministrator":true,"IsHidden":false,'
                '"IsDisabled":false,"BlockedTags":[],'
                '"EnableUserPreferenceAccess":true,"AccessSchedules":[],'
                '"BlockUnratedItems":[],'
                '"EnableRemoteControlOfOtherUsers":false,'
                '"EnableSharedDeviceControl":true,'
                '"EnableLiveTvManagement":true,"EnableLiveTvAccess":true,'
                '"EnableMediaPlayback":true,'
                '"EnableAudioPlaybackTranscoding":true,'
                '"EnableVideoPlaybackTranscoding":true,'
                '"EnableContentDeletion":false,'
                '"EnableContentDownloading":true,'
                '"EnableSync":true,"EnableSyncTranscoding":true,'
                '"EnabledDevices":[],"EnableAllDevices":true,'
                '"EnabledChannels":[],"EnableAllChannels":true,'
                '"EnabledFolders":[],"EnableAllFolders":true,'
                '"InvalidLoginAttemptCount":0,"EnablePublicSharing":true}}]')

        responses.add(responses.GET,
                      'http://localhost:8096/Users/Public',
                      body=body,
                      status=200,
                      content_type='application/json')

        response = embyupdate.get_user('localhost', 8096, 'username')

        self.assertEqual(response[0]['Id'],
                         '2ec276a2642e54a19b612b9418a8bd3b')

        self.assertEqual(response[0]['Name'],
                         'username')