Beispiel #1
0
    def test_opened_issues_trend(self):
        """
        Test the the opened issues metric trend.
        """

        opened_issues = github_issues.OpenedIssues(self.github_index, self.start, self.end)
        last, trend_percentage = get_trend(opened_issues.timeseries())
        self.assertEquals(last, OPENED_TREND_LAST)
        self.assertEquals(trend_percentage, OPENED_TREND_PRECENTAGE)
Beispiel #2
0
    def test_opened_issues_timeseries_with_df(self):
        """
        Test if the timeseries dataframe for opened issues metrics
        are returned correctly or not.
        """

        opened_issues = github_issues.OpenedIssues(self.github_index, self.start, self.end)
        opened_issues_ts = opened_issues.timeseries(dataframe=True)
        opened_issues_test = pd.read_csv(OPENED_ISSUES_BY_MONTH)
        self.assertIsInstance(opened_issues_ts, pd.DataFrame)
        assert_array_equal(opened_issues_test['value'], opened_issues_ts['value'])
Beispiel #3
0
    def test_opened_issues_timeseries_non_df(self):
        """
        Test if the timeseries for opened issues metrics
        are returned correctly or not.
        """

        opened_issues = github_issues.OpenedIssues(self.github_index, self.start, self.end)
        opened_issues_ts = opened_issues.timeseries()
        opened_issues_test = pd.read_csv(OPENED_ISSUES_BY_MONTH)
        opened_issues_test['date'] = [parser.parse(item).date() for item in opened_issues_test['date']]
        assert_array_equal(opened_issues_test['date'], opened_issues_ts['date'])
        assert_array_equal(opened_issues_test['value'], opened_issues_ts['value'])