Exemple #1
0
    def test_project_name_random(self):
        data = json.loads(json.dumps(self.default_data))
        data['projectName'] = 'randomprojectskldfjlsdfjsd'

        with self.assertRaises(Exception):
            with open(self.default_file_path, 'rb') as f:
                groupware.post_report(self.auth_token, data,
                                      {'evidenceTask': f})
Exemple #2
0
def post_report_single(username, fields, image_data):
    """ send a single report """
    print('sending report for ' + username)

    files = {
        'evidenceTask': ('image.' + image_data['type'], image_data['content'],
                         'image/' + image_data['type']),
    }

    auth_token = user.get_user_token(username)
    res = groupware.post_report(auth_token, fields, files)
    print('ok')
    return True
Exemple #3
0
    def test_project_name_random_case(self):
        data = json.loads(json.dumps(self.default_data))
        data['projectName'] = 'SaPaWarGa'

        with open(self.default_file_path, 'rb') as f:
            groupware.post_report(self.auth_token, data, {'evidenceTask': f})
Exemple #4
0
 def test_normal_input(self):
     with open(self.default_file_path, 'rb') as f:
         groupware.post_report(self.auth_token, self.default_data,
                               {'evidenceTask': f})