Exemplo n.º 1
0
    def test_run_workflow_wilson_owners_optimized_at_runtime(self):
        create_dict_using_json.main()

        self.assertTrue(
            compute_stats.run_workflow(quality_measure_str='wilson_score',
                                       popularity_measure_str='num_owners',
                                       perform_optimization_at_runtime=True,
                                       num_top_games_to_print=50,
                                       verbose=False))
Exemplo n.º 2
0
    def test_run_workflow_bayes_reviews(self):
        create_dict_using_json.main()

        self.assertTrue(
            compute_stats.run_workflow(quality_measure_str='bayesian_rating',
                                       popularity_measure_str='num_reviews',
                                       perform_optimization_at_runtime=False,
                                       num_top_games_to_print=50,
                                       verbose=True))
Exemplo n.º 3
0
    def test_run_workflow_filtering_in_unknown_tag(self):
        create_dict_using_json.main()

        self.assertTrue(
            compute_stats.run_workflow(quality_measure_str='wilson_score',
                                       popularity_measure_str='num_reviews',
                                       perform_optimization_at_runtime=False,
                                       num_top_games_to_print=50,
                                       verbose=False,
                                       language=None,
                                       keywords_to_include=["Rogue-Like"],
                                       keywords_to_exclude=None))
Exemplo n.º 4
0
    def test_run_workflow_while_removing_reference_hidden_gems(self):
        create_dict_using_json.main()

        # A dictionary will be stored in the following text file
        dict_filename = "dict_top_rated_games_on_steam.txt"

        import ast

        # Import the local dictionary from the input file
        with open(dict_filename, 'r', encoding="utf8") as infile:
            lines = infile.readlines()
            # The dictionary is on the second line
            # noinspection PyPep8Naming
            D = ast.literal_eval(lines[1])

        for appid in appids.appid_hidden_gems_reference_set:
            print(
                'Ensuring reference {} (appID={}) does not appear in the final ranking.'
                .format(D[appid][0], appid))
            D[appid][-1] = False
            # If True, UnEpic should end up about rank 1828. Otherwise, UnEpic should not appear on there.

        # Save the dictionary to a text file
        with open(dict_filename, 'w', encoding="utf8") as outfile:
            print(create_dict_using_json.get_leading_comment(), file=outfile)
            print(D, file=outfile)

        self.assertTrue(
            compute_stats.run_workflow(
                quality_measure_str='wilson_score',
                popularity_measure_str='num_reviews',
                perform_optimization_at_runtime=False,
                num_top_games_to_print=2000,
                verbose=True,
                language=None,
                keywords_to_include=["Action", "Indie", "RPG"],
                keywords_to_exclude=None))
Exemplo n.º 5
0
 def test_main(self):
     self.assertTrue(create_dict_using_json.main())
Exemplo n.º 6
0
    def test_main(self):
        create_dict_using_json.main()

        self.assertTrue(compute_stats.main())