<commit_before>import json
from .tests import BaseTest


class BucketlistTestCase(BaseTest):

    def Setup(self):
        pass

    def test_create_bucketlist(self):
        """ test create new bucketlist """
        pass

    def test_unathorized_bucketlist_creation(self):
        """ test creating a bucketlist without being logged in """
        pass

    def test_create_invalid_bucketlist(self):
        """ test creating bucketlist with empty data """
        pass

    def test_get_bucketlists(self):
        """ test get all bucketlists of a user """
        pass

    def test_get_bucketlist(self):<commit_msg>add test cases for creating a bucketlist<commit_after>import json
from .tests import BaseTest


class BucketlistTestCase(BaseTest):

    def Setup(self):
        pass

    def test_create_bucketlist(self):
        """ test create new bucketlist """
        user = {'username': 'default_user', 'password': 'password'}
        response = self.client.post('/auth/login', data=user)
        self.assertEqual(response.status_code, 200)

        # extract auth_token
        user_auth = json.loads(response.data)
        auth_token = user_auth['auth_token']
        headers = {'auth_token': auth_token}
        form = {'name': 'Trip to paris'}
        url = '/bucketlists/'

        # create bucket list
        response = self.client.post(url, data=form, headers=headers)
        self.assertEqual(response.status_code, 201)
        self.assertIn('Successfully created bucketlist', response.data.decode())

    def test_unathorized_bucketlist_creation(self):
        """ test creating a bucketlist without being logged in """
        form = {'name': 'bucketlist while not loggedin'}
        url = '/bucketlists/'

        response = self.client.post(url, data=form)
        self.assertEqual(response.status_code, 401)
        self.assertIn('Forbidden Access', response.data.decode())

    def test_create_bucketlist_invalid_token(self):
        """ test create a bucketlist with an invalid token """
        form = {'name': 'Bucketlist invalid token'}
        headers = {'auth_token': ''}
        url = '/bucketlists/'

        # create bucket list
        response = self.client.post(url, data=form, headers=headers)
        self.assertEqual(response.status_code, 401)
        self.assertIn('Forbidden Access', response.data.decode())

    def test_create_invalid_bucketlist(self):
        """ test creating bucketlist with empty data """
        pass

    def test_get_bucketlists(self):
        """ test get all bucketlists of a user """
        pass

    def test_get_bucketlist(self):
{'fraction_non_alphanumeric': 0.10483870967741936, 'fraction_numerical': 0.004608294930875576, 'mean_word_length': 2.8764880952380953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4023830', 'n_tokens_mistral': 726, 'n_tokens_neox': 695, 'n_words': 189}