def test_parse_general_stats(self):
        json_data = log_analyzer.parse_log(log_file)
        json_data = log_analyzer.sort_records_by("best_score", json_data)
        stats = log_analyzer.parse_general_stats(json_data)

        # import matplotlib.pyplot as plt
        # from pylab import figure
        # figure(facecolor='white')
        # plt.scatter(stats["best_scores"], stats["runtimes"])
        # plt.xlabel("best_scores")
        # plt.ylabel("runtimes")
        # plt.show()

        # assert
        self.assertIsNotNone(stats["best_individuals"])
        self.assertIsNotNone(stats["best_scores"])
        self.assertIsNotNone(stats["runtimes"])
    def test_sort_records_by(self):
        json_data = log_analyzer.parse_log(log_file)
        json_data = log_analyzer.sort_records_by("best_score", json_data)

        # runtimes = []
        # best_scores = []
        # for record in json_data:
        #     runtimes.append(record["runtime"])
        #     best_scores.append(record["best_score"])

        # import matplotlib.pyplot as plt
        # plt.scatter(best_scores, runtimes)
        # plt.show()

        # assert
        prev = json_data.pop(0)["best_score"]
        for record in json_data:
            self.assertTrue(record["best_score"] >= prev)
            prev = record["best_score"]