<commit_before>import json
import os
import time
import uuid
import requests

from uuid import UUID


class Test_notifications(object):
    def test_project_notification(self, session, flask_api_url, pytestconfig):
        # login first
        requests.post(flask_api_url + '/api/users/login',
                      data=dict(email='<EMAIL>', password="<PASSWORD>"))
        # add some project and save id
        test_manifest = os.path.join(
            str(pytestconfig.rootdir),
            'tests',
            'testmanifests',
            'validexample01.json5'
        )
        with open(test_manifest, 'r', encoding='utf-8') as tf:
            data = str(tf.read().replace('\n', ''))
        response = session.post(flask_api_url + "/api/projects",
                                data=data.encode('utf-8'),
                                headers={'Content-Type': 'application/json5'})
        projects_id = response.json()[0]
        # assert(response.json()== 33)
        requests.post(
            flask_api_url + '/api/projects/' + projects_id + '/comment',
            data='new comment')
        requests.get(flask_api_url + '/api/users/logout')
        requests.post(flask_api_url + '/api/users/login',
                      data=dict(email='<EMAIL>', password="<PASSWORD>"))
        user_notifications = requests.get(
            flask_api_url + '/api/users/notifications').json()
        assert (
            user_notifications['link'] == '/project/' + projects_id)<commit_msg>correcting request method for logged user<commit_after>import json
import os
import time
import uuid
import requests

from uuid import UUID


class Test_notifications(object):
    def test_project_notification(self, session, flask_api_url, pytestconfig):
        # login first
        requests.post(flask_api_url + '/api/users/login',
                      data=dict(email='<EMAIL>', password="<PASSWORD>"))
        # add some project and save id
        test_manifest = os.path.join(
            str(pytestconfig.rootdir),
            'tests',
            'testmanifests',
            'validexample01.json5'
        )
        with open(test_manifest, 'r', encoding='utf-8') as tf:
            data = str(tf.read().replace('\n', ''))
        response = session.post(flask_api_url + "/api/projects",
                                data=data.encode('utf-8'),
                                headers={'Content-Type': 'application/json5'})
        projects_id = response.json()[0]
        # assert(response.json()== 33)
        session.post(
            flask_api_url + '/api/projects/' + projects_id + '/comment',
            data='new comment')
        session.get(flask_api_url + '/api/users/logout')
        session.post(flask_api_url + '/api/users/login',
                      data=dict(email='<EMAIL>', password="<PASSWORD>"))
        user_notifications = session.get(
            flask_api_url + '/api/users/notifications').json()
        assert (
            user_notifications[0]['link'] == '/project/' + projects_id)
{'fraction_non_alphanumeric': 0.13373055279708707, 'fraction_numerical': 0.006289308176100629, 'mean_word_length': 2.1677148846960166, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4017637', 'n_tokens_mistral': 877, 'n_tokens_neox': 867, 'n_words': 160}