#get a sample hi-res album art url
        sample_image_url = self.get_art_url()
        self.verifyIsNotNoneOrStop(
            sample_image_url,
            "The hi-res albumArtURI ({0}) should be something other than None."
            .format(sample_image_url))

        self.verify_image_url_substitution(sample_image_url,
                                           images_substitution_list,
                                           images_sizes_list)


#Main
if __name__ == "__main__":

    parser = ServiceConfigOptionParser(sys.argv)

    suite = BasicWorkflowTestSuite("Presentation map Validation",
                                   args=parser.args)

    suite.smapiservice = SMAPIService(parser.config_file, parser.wsdl,
                                      getattr(parser.options, 'content_file'),
                                      suite.logger, suite.console_logger)
    suite.client = suite.smapiservice.buildservice()
    suite.client.login()

    f = Albumart(suite.client, suite.smapiservice)
    f.initialize()

    suite.run(f)
Exemple #2
0
def development_mode(config_file, args=[]):

    servicename = path.basename(
        config_file)  # take the file name like amazon.cfg
    configfile = config_file  # the dir + file name
    logfilename = path.splitext(servicename)[0]  # remove the extension

    # check for existence of the config file
    if not path.exists(configfile):
        raise Exception("Configuration file %s not found." % configfile)

    suite = BasicWorkflowTestSuite(logfilename, args=args)
    fixtures = []
    '''check if configuration file we read from the ServiceList exist'''
    try:
        path.exists(configfile) and path.isfile(configfile) and access(
            configfile, R_OK)
    except IOError:
        sys.exit(1)

    suite.configfile = configfile
    suite.smapiservice = SMAPIService(suite.configfile,
                                      wsdl=parser.wsdl,
                                      content_file=parser.options.content_file,
                                      logger=suite.logger,
                                      console_logger=suite.console_logger)
    suite.client = suite.smapiservice.buildservice()
    suite.client.login()
    suite.logger.info("Service Name: %s" %
                      safe_str(suite.smapiservice.svcName))
    suite.console_logger.info("Service Name: %s" %
                              safe_str(suite.smapiservice.svcName))

    getuserinfo.suite = suite
    f = getuserinfo.GetUserInfoTest(suite.client, suite.smapiservice)
    fixtures.append(f)

    # Relying on the fact that order is maintained in python lists, the updatetestcontent suite must run before any test
    # case that can change user's favorites (i.e., playlists, favorites, ratings)
    updatetestcontent.suite = suite
    f = updatetestcontent.UpdateTestContent(suite.client, suite.smapiservice)
    f.initialize()
    fixtures.append(f)

    smapimethodvalidation.suite = suite
    f = smapimethodvalidation.SMAPIMethodValidation(suite.client,
                                                    suite.smapiservice)
    fixtures.append(f)

    playlist.suite = suite
    f = playlist.CreatePlaylist(suite.client, suite.smapiservice)
    f.create_playlist_with_seed_generator = playlist.generate_function_name_strings(
    )
    f.playlist_in_folder_with_seed_generator = playlist.generate_function_name_strings(
    )
    fixtures.append(f)

    f = playlist.DeletePlaylist(suite.client, suite.smapiservice)
    fixtures.append(f)

    f = playlist.RenamePlaylist(suite.client, suite.smapiservice)
    fixtures.append(f)

    f = playlist.AddToPlaylist(suite.client, suite.smapiservice)
    f.cannot_add_to_noneditable_playlist_generator = playlist.generate_items_for_addtoContainer_playlist_test(
    )
    f.can_add_to_playlist_generator = playlist.generate_items_for_addtoContainer_playlist_test(
    )
    fixtures.append(f)

    f = playlist.ReorderPlaylistContainer(suite.client, suite.smapiservice)
    f.generate_can_reorder_data = playlist.generate_reordering_data()
    f.generate_cannot_reorder_data = playlist.generate_cannot_reordering_data()
    fixtures.append(f)

    albumart.suite = suite
    f = albumart.Albumart(suite.client, suite.smapiservice)
    f.create_local_dir()
    f.create_html_result_file()
    fixtures.append(f)

    ratings.suite = suite
    fixtures.append(ratings.Ratings(suite.client, suite.smapiservice))

    favorites.suite = suite
    f = favorites.Favorites(suite.client, suite.smapiservice)
    f.favorite_type_add = favorites.generate_name_strings()
    f.favorite_type_remove = favorites.generate_name_strings()
    fixtures.append(f)

    browse.suite = suite
    f = browse.Browse(suite.client, suite.smapiservice)
    f.test_scroll_driller = f.generate_iterative_list_drill(
        f.determiner_browse_scroll)
    f.test_leaf_driller = f.generate_iterative_list_drill(
        f.determiner_browse_leaf)
    f.pagination_total_count = f.generate_iterative_list_drill(
        f.determiner_browse_pagination)
    f.pagination_container = browse.generate_pagination_container(
        f.generate_iterative_list_drill(f.determiner_pagination_container))
    f.pagination_container_nooverlap = browse.generate_pagination_container(
        f.generate_iterative_list_drill(f.determiner_pagination_container))
    fixtures.append(f)

    httpverifications.suite = suite
    fixtures.append(
        httpverifications.HTTPBasedTests(suite.client, suite.smapiservice))

    search.suite = suite
    f = search.Search(suite.client, suite.smapiservice)
    f.initialize()
    fixtures.append(f)

    progvalidation.suite = suite
    f = progvalidation.Progvalidation(suite.client, suite.smapiservice)
    f.test_program_driller = f.generate_iterative_list_drill(
        f.determiner_program)
    f.test_pagination_total_count = f.generate_iterative_list_drill(
        f.determiner_browse_pagination)
    fixtures.append(f)

    streamvalidation.suite = suite
    f = streamvalidation.StreamValidation(suite.client, suite.smapiservice)
    f.test_stream_driller = f.generate_iterative_list_drill(
        f.determiner_stream)
    fixtures.append(f)

    stringtable.suite = suite
    f = stringtable.Stringtable(suite.client, suite.smapiservice)
    f.language = stringtable.generate_language_list()
    fixtures.append(f)

    presentationmap.suite = suite
    f = presentationmap.Presentationmap(suite.client, suite.smapiservice)
    fixtures.append(f)

    extendedmetadatavalidations.suite = suite
    f = extendedmetadatavalidations.ExtendedMetadataValidations(
        suite.client, suite.smapiservice)
    f.metadata_data = extendedmetadatavalidations.generate_test_data()
    fixtures.append(f)

    getlastupdate.suite = suite
    fixtures.append(
        getlastupdate.PollingIntervalTest(suite.client, suite.smapiservice))

    authentication.suite = suite
    fixtures.append(
        authentication.Authentication(suite.client, suite.smapiservice))

    smapi_reporting.suite = suite
    f = smapi_reporting.SMAPIReporting(suite.client, suite.smapiservice)
    fixtures.append(f)

    # ssl_validation.suite = suite
    # f = ssl_validation.ssl_validation(suite.client, suite.smapiservice)
    # fixtures.append(f)

    try:
        import servicecatalog
        import mslogo

        servicecatalog.suite = suite
        f = servicecatalog.ServiceCatalog(suite.client, suite.smapiservice)
        fixtures.append(f)

        mslogo.suite = suite
        f = mslogo.MSLogo(suite.client, suite.smapiservice)
        fixtures.append(f)
    except:
        pass

    # Run it
    suite.run(fixtures)
        self.verifyTrueOrSkip(self.smapiservice.get_test_track_id(), "Service must provide a valid track ID and/or "
                                                                     "stream ID ([Test Content]:track/stream in the "
                                                                     "config file) for this test to run.")

        media_uri = self.client.getMediaURI(self.smapiservice.get_test_track_id(), self)
        self.verifyIsNotNoneOrStop(media_uri, "getMediaURI should return something other than None.")
        self.verifyInOrStop('getMediaURIResult', media_uri, "getMediaUri should return a getMediaURIResult.")

#Main
if __name__ == "__main__":
    path_to_configs = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..','service_configs'))
    # find all .cfg files
    partner_cfgs = glob.glob1(path_to_configs, '*.cfg')

    fixture = []
    for cfg_file in partner_cfgs:
        config_file = os.path.normpath(os.path.join(path_to_configs, cfg_file))
        config = ConfigParser.SafeConfigParser(allow_no_value=True)
        config.read(config_file)

        service_name = config.get('Service Name', 'serviceName')
        if service_name:
            smapiservice = SMAPIService(config_file)
            # only do validation for service that uses SessionId authentication
            if smapiservice.get_authType() == USERID:
                client = smapiservice.buildservice()
                fixture.append(Credential(client, smapiservice))

    suite = BasicWorkflowTestSuite("Validate Credentials", args=None)
    suite.run(fixture)
Exemple #4
0
                continue
            except NotLinkedFailure as failure_exception:
                self.stop('Encountered NOT_LINK_FAILURE {0}'.format(failure_exception))
                break
            except Exception as e:
                self.stop('Found unknown exception: {0}'.format(e))
                break
        else:
            self.fail('Polling timeout, have not received a response within 8 minutes')

    # TODO: Once the story to consolidate the loggers on the parent class into one call is complete this can be removed
    def log_message(self, message, level='INFO'):
        if level == 'ERROR':
            self.console_logger.error(message)
            self.logger.error(message)
        elif level == 'WARN':
            self.console_logger.warn(message)
            self.logger.warn(message)
        else:
            self.console_logger.info(message)
            self.logger.info(message)

# Main
if __name__ == "__main__":
    parser = ServiceConfigOptionParser(sys.argv)
    suite = BasicWorkflowTestSuite("Device Link Test", args=parser.args)

    smapi_service = SMAPIService(parser.config_file, content_file=getattr(parser.options, 'content_file'), logger=suite.logger, console_logger=suite.console_logger)
    client = smapi_service.buildservice()

    suite.run(DeviceLink(client, smapi_service))
Exemple #5
0
            response = self.client.getMediaMetadata(
                get_test_content_driller.id, self)
            self.verifyIsNotNoneOrFailCase(
                response,
                "Requesting getMediaMetadata on a stream should not return None"
            )
            if self.test_content_needed.get(STREAM) is True and hasattr(response, 'title') \
                and hasattr(response, 'id'):
                self.test_content_needed[STREAM] = False
                self.smapiservice.set_test_content(response.title, response.id,
                                                   STREAM)

        self.smapiservice.__init__(self.smapiservice.configfile, parser.wsdl,
                                   CRAWLER_DISABLE)


#Main
if __name__ == "__main__":
    parser = ServiceConfigOptionParser(sys.argv)

    suite = BasicWorkflowTestSuite("Update Test Content", args=parser.args)

    suite.smapiservice = SMAPIService(parser.config_file, parser.wsdl,
                                      CRAWLER_DISABLE)
    suite.client = suite.smapiservice.buildservice()
    suite.client.login()

    f = UpdateTestContent(suite.client, suite.smapiservice)
    f.initialize()

    suite.run(f)