<commit_before>"""
Team Testing Module
"""

import pytest
import api.user
import api.team
import api.common
import bcrypt

from api.common import WebException, InternalException
from common import clear_collections, ensure_empty_collections
from conftest import setup_db, teardown_db

class TestTeams(object):
    """
    API Tests for team.py
    """

    base_team = {
        "team_name": "team",
        "adviser_name": "Dr. Test",
        "adviser_email": "<EMAIL>",
        "school": "Test HS",
        "password": "<PASSWORD>",
        "eligible": True
    }

    base_user = {
        "username": "valid",
        "password": "<PASSWORD>",
        "email": "<EMAIL>",
        "create-new-team": "false",

        "team-name-existing": base_team['team_name'],
        "team-password-existing": base_team['password']
    }

    def setup_class(self):
        setup_db()

    def teardown_class(self):
        teardown_db()

    @ensure_empty_collections("teams")
    @clear_collections("teams")
    def test_create_batch_teams(self, teams=10):
        """
        Tests team creation.

        Covers:
            team.create_team
            team.get_team
            team.get_all_teams
        """
        tids = []
        for i in range(teams):<commit_msg>Team tests now pass.<commit_after>"""
Team Testing Module
"""

import pytest
import api.user
import api.team
import api.common
import bcrypt

from api.common import WebException, InternalException
from common import clear_collections, ensure_empty_collections
from conftest import setup_db, teardown_db

class TestTeams(object):
    """
    API Tests for team.py
    """

    base_team = {
        "team_name": "team",
        "school": "Test HS",
        "password": "<PASSWORD>",
        "eligible": True
    }

    base_user = {
        "username": "valid",
        "firstname": "Fred",
        "lastname": "Hacker",
        "password": "<PASSWORD>",
        "email": "<EMAIL>",
        "ctf-emails": False,
        "create-new-team": "false",
        "background": "student_hs",
        "country": "US",
        "team-name-existing": base_team['team_name'],
        "team-password-existing": base_team['password']
    }

    def setup_class(self):
        setup_db()

    def teardown_class(self):
        teardown_db()

    @ensure_empty_collections("teams")
    @clear_collections("teams")
    def test_create_batch_teams(self, teams=10):
        """
        Tests team creation.

        Covers:
            team.create_team
            team.get_team
            team.get_all_teams
        """
        tids = []
        for i in range(teams):
{'fraction_non_alphanumeric': 0.12887189292543022, 'fraction_numerical': 0.0015296367112810707, 'mean_word_length': 2.401820546163849, 'pattern_counts': {'":': 27, '<': 10, '<?xml version=': 0, '>': 10, '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': '2187972', 'n_tokens_mistral': 823, 'n_tokens_neox': 802, 'n_words': 179}