<commit_before>#!/usr/bin/python2.4
#
# Copyright (c) 2004-2005 rpath, Inc.
#

import testsuite
testsuite.setup()

from mint_rephelp import MintRepositoryHelper

from mint import mint_server

class AuthTest(MintRepositoryHelper):
    def testNewUser(self):
        client = self.getMintClient("testuser", "testpass")
        auth = client.checkAuth()
        assert(auth.authorized)

    def testBadUser(self):
        client = self.getMintClient("testuser", "testpass")

        client = self.openMint(("testuser", "badpass"))
        auth = client.checkAuth()
        assert(not auth.authorized)

if __name__ == "__main__":<commit_msg>test case to ensure new account names with only case-sensitivity differences cannot be created<commit_after>#!/usr/bin/python2.4
#
# Copyright (c) 2004-2005 rpath, Inc.
#

import testsuite
testsuite.setup()

from mint_rephelp import MintRepositoryHelper

from mint import mint_server

from mint import users

class AuthTest(MintRepositoryHelper):
    def testNewUser(self):
        client = self.getMintClient("testuser", "testpass")
        auth = client.checkAuth()
        assert(auth.authorized)

    def testBadUser(self):
        client = self.getMintClient("testuser", "testpass")

        client = self.openMint(("testuser", "badpass"))
        auth = client.checkAuth()
        assert(not auth.authorized)

    def testConflictingUser(self):
        client = self.getMintClient("testuser", "testpass")
        # make two accounts with a case sensitive clash.
        userId = client.registerNewUser("member", "memberpass", "Test Member",
                                        "<EMAIL>", "test at example.com", "", active=True)
        try:
            userId = client.registerNewUser("Member", "memberpass", "Test Member",
                                            "<EMAIL>", "test at example.com", "", active=True)
            # the above line should have raised an exception. if code flow
            # reaches this point, that's an error.
            assert (1 == 0)
        except users.GroupAlreadyExists:
            pass
        userId = client.registerNewUser("different", "memberpass", "Test Member",
                                        "<EMAIL>", "test <EMAIL>", "", active=True)


if __name__ == "__main__":
{'fraction_non_alphanumeric': 0.11487676056338028, 'fraction_numerical': 0.009683098591549295, 'mean_word_length': 2.6959349593495934, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4249051', 'n_tokens_mistral': 645, 'n_tokens_neox': 619, 'n_words': 167}