Example #1
0
    def setUp(self):
        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/issue1.json", 'r', encoding='utf-8') as \
                issue_1_file:
            self.issue_1 = json.load(issue_1_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/issue95.json", 'r', encoding='utf-8') as \
                issue_95_file:
            self.issue_95 = json.load(issue_95_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/issue95_comments.json", 'r', encoding='utf-8') as \
                issue_95_comments_file:
            self.issue_95_comments = json.load(issue_95_comments_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/issue95_history.json", 'r', encoding='utf-8') as \
                issue_95_history_file:
            self.issue_95_history = json.load(issue_95_history_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/conor_apache_org_user.json", 'r', encoding='utf-8') as \
                conor_user_file:
            self.conor_user = json.load(conor_user_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/dev_tomcat_apache_org_user.json", 'r', encoding='utf-8') as \
                dev_tomcat_file:
            self.dev_tomcat_file = json.load(dev_tomcat_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/bugzilla/craig_mcclanahan_user.json", 'r', encoding='utf-8') as \
                craig_user_file:
            self.craig_user = json.load(craig_user_file)

        # Create testconfig
        config = configparser.ConfigParser()
        config.read(
            os.path.dirname(os.path.realpath(__file__)) +
            "/data/used_test_config.cfg")

        # Setting up database with data that is normally put into it via vcs program
        connect(config['Database']['db_database'],
                username=config['Database']['db_user'],
                password=config['Database']['db_password'],
                host=config['Database']['db_hostname'],
                port=int(config['Database']['db_port']),
                authentication_source=config['Database']['db_authentication'],
                connect=False)

        Project.drop_collection()
        IssueSystem.drop_collection()
        Issue.drop_collection()
        IssueComment.drop_collection()
        Event.drop_collection()

        self.project_id = Project(name='Bla').save().id
        self.issues_system_id = IssueSystem(
            project_id=self.project_id,
            url="https://issues.apache.org/search?jql=project=BLA",
            last_updated=datetime.datetime.now()).save().id

        self.conf = ConfigMock(None, None, None, None, None, None, 'Bla',
                               'Nonsense?product=Blub', 'bugzilla', None, None,
                               None, None, None, None, 'DEBUG', '123')
Example #2
0
    def setUp(self):
        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/people.json", 'r', encoding='utf-8') as people_file:
            self.person = json.load(people_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/issue_6131.json", 'r', encoding='utf-8') as issues_file:
            self.issue_6131 = json.load(issues_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/issue_6131_events.json", 'r', encoding='utf-8') as event_file:
            self.events_issue_6131 = json.load(event_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/issue_6131_comments.json", 'r', encoding='utf-8') as cmt_file:
            self.comments_issue_6131 = json.load(cmt_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/issue_6050.json", 'r', encoding='utf-8') as issues_file:
            self.issue_6050 = json.load(issues_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/issue_6050_events.json", 'r', encoding='utf-8') as event_file:
            self.events_issue_6050 = json.load(event_file)

        with open(os.path.dirname(os.path.realpath(__file__)) + "/data/github/issue_6050_comments.json", 'r', encoding='utf-8') as cmt_file:
            self.comments_issue_6050 = json.load(cmt_file)

        # Create testconfig
        config = configparser.ConfigParser()
        config.read(os.path.dirname(os.path.realpath(__file__)) + "/data/used_test_config.cfg")

        # Setting up database with data that is normally put into it via vcs program
        connect(config['Database']['db_database'], username=config['Database']['db_user'],
                password=config['Database']['db_password'], host=config['Database']['db_hostname'],
                port=int(config['Database']['db_port']),
                authentication_source=config['Database']['db_authentication'],
                connect=False)

        Project.drop_collection()
        IssueSystem.drop_collection()
        Issue.drop_collection()
        IssueComment.drop_collection()
        Event.drop_collection()

        self.project_id = Project(name='Composer').save().id
        self.issues_system_id = IssueSystem(project_id=self.project_id, url="http://blub.de",
                                            last_updated=datetime.datetime.now()).save().id

        self.conf = ConfigMock(None, None, None, None, None, None, 'Ant', 'http://blub.de', 'github', None, None, None,
                               None, None, None, 'DEBUG', '123')
    def setUp(self):
        with open(os.path.dirname(os.path.realpath(__file__)) +
                  "/data/jira/drill_1_issue.json",
                  'r',
                  encoding='utf-8') as drill_1:
            self.issue_drill_1 = json.load(drill_1)

        with open(os.path.dirname(os.path.realpath(__file__)) +
                  "/data/jira/drill_138_issue.json",
                  'r',
                  encoding='utf-8') as drill_138:
            self.issue_drill_138 = json.load(drill_138)

        with open(os.path.dirname(os.path.realpath(__file__)) +
                  "/data/jira/drill_38_issue.json",
                  'r',
                  encoding='utf-8') as drill_38:
            self.issue_drill_38 = json.load(drill_38)

        with open(os.path.dirname(os.path.realpath(__file__)) +
                  "/data/jira/get_user1.json",
                  'r',
                  encoding='utf-8') as user1_file:
            self.user1 = json.load(user1_file)

        with open(os.path.dirname(os.path.realpath(__file__)) +
                  "/data/jira/get_user2.json",
                  'r',
                  encoding='utf-8') as user2_file:
            self.user2 = json.load(user2_file)

        # Create testconfig
        config = configparser.ConfigParser()
        config.read(
            os.path.dirname(os.path.realpath(__file__)) +
            "/data/used_test_config.cfg")

        # Setting up database with data that is normally put into it via vcs program
        connect(config['Database']['db_database'],
                username=config['Database']['db_user'],
                password=config['Database']['db_password'],
                host=config['Database']['db_hostname'],
                port=int(config['Database']['db_port']),
                authentication_source=config['Database']['db_authentication'],
                connect=False)

        Project.drop_collection()
        IssueSystem.drop_collection()
        Issue.drop_collection()
        IssueComment.drop_collection()
        Event.drop_collection()

        self.project_id = Project(name='Bla').save().id
        self.issues_system_id = IssueSystem(
            project_id=self.project_id,
            url="https://issues.apache.org/search?jql=project=BLA",
            last_updated=datetime.datetime.now()).save().id

        self.conf = ConfigMock(
            None, None, None, None, None, None, 'Bla',
            'https://issues.apache.org/search?jql=project=BLA', 'jira', None,
            None, None, None, None, None, 'DEBUG', '123')