コード例 #1
0
    def setUp(self):
        """Set up the necessary functions to run unittests"""

        self.github_index = Index(index_name=ENRICH_INDEX,
                                  es=TestElasticsearch.es)

        self.Query_test_object = Query(self.github_index)

        self.field1 = "hash"
        self.field2 = "author_name"
        self.field3 = "lines_added"
        self.field4 = "lines_changed"
        self.date_field1 = "grimoire_creation_date"
        self.date_field2 = "commit_date"

        # Using sample filters not related to the GIT_INDEX
        self.filters = [{"item_type": "pull_request"}, {"item_type": "issue"}]
        self.offset = 2
        self.interval = "month"
        self.timezone = "UTC"

        # Make sure to change the CONSTANTS defined above if you change
        # the end date here before testing because tests might fail otherwise
        self.start = datetime(2015, 1, 1)  # from date
        self.end = datetime(2018, 7, 10)  # to date
        self.size = 10000
        self.precision_threshold = 3000
コード例 #2
0
    def setUp(self):
        """
        Set up the necessary functions to run unittests.
        """

        self.git_index = Index(index_name=ENRICH_INDEX, es=TestGit.es)

        # Set the interval for the data that is to be tested
        # This will set the interval for all the query objects used
        Query.interval_ = "month"

        # Make sure to change the CONSTANTS defined above if you change
        # the end date here before testing because tests might fail otherwise
        self.start = datetime(2015, 1, 1)  # from date
        self.end = datetime(2018, 7, 10)  # to date