def test_get_project_setting(self):
        data = {'repositories': {'action': 'remove', 'Github': [182191121]}}
        self.model.add_project('test_get_project_setting')
        pid = self.get_pid_by_name('test_get_project_setting')

        data, code = self.model.get_project_setting(pid)
        setting = Setting('test_get_project_setting', [],
                          UserModel(FakeConnTool())).to_dict()
        assert (setting, status_code.OK) == (data, code)
        self.model.delete_project(self.get_pid_by_name('test_remove_repo'))
Beispiel #2
0
 def setUp(self):
     self.model = ProjectCodeFrequencyModel(FakeConnTool())
     self.test1_code_freq = [
         {"date": "2020/3/10", "code": 30}, {"date": "2020/4/10", "code": 60},
         {"date": "2020/5/10", "code": 100}, {"date": "2020/6/10", "code": 0},
         {"date": "2020/7/10", "code": 0}
     ]
     self.test2_code_freq = [
         {"date": "2020/5/10", "code": 55}, {"date": "2020/6/10", "code": 15},
         {"date": "2020/8/10", "code": 52}, {"date": "2020/7/10", "code": 10},
         {"date": "2020/9/10", "code": 0}
     ]
    def test_update_collaborator(self):
        self.model.add_project('test_update_collaborator')

        pid = self.get_pid_by_name('test_update_collaborator')
        data, code = self.model.update_collaborator(pid,
                                                    '*****@*****.**',
                                                    'add')
        update_pro = self.model._db.collection('projects').document(
            pid).get().to_dict()
        userModel = UserModel(FakeConnTool())
        print(update_pro['collaborator'])
        assert update_pro['collaborator'] == [
            userModel.get_user_info_by_email('*****@*****.**')[0]['uid']
        ]
        self.model.delete_project(
            self.get_pid_by_name('test_update_collaborator'))
 def setup_class(self):
     self.model = ProjectIssueMessageModel(FakeConnTool())
 def setup_class(self):
     self.model = ProjectModel(FakeConnTool())
 def setup_class(self):
     self.model = UserModel(FakeConnTool())