Beispiel #1
0
    def test_not_matching_expressions(self):
        """ test user search expression not matching"""

        token_owner = "*****@*****.**"
        token_user_dict = {'match':token_owner}

        for user_search in [
            'maxwell',
            'maxwell@hotad.*.ned',
            'maxwell@hod*net',
            'maxwell@hod*',
            "*[email protected]",
            '*oxwell@hot*', ]:

            serials = _user_expression_match(user_search,
                                             token_user_dict.items())

            assert 'match' not in serials

        return
Beispiel #2
0
    def test_matching_expressions(self):
        """test user search expression matching"""

        token_owner = "*****@*****.**"
        token_user_dict = {'match': token_owner}

        for user_search in [
                'maxwell*',
                'maxwell@hotad.*.net',
                'maxwell@hot*net',
                'maxwell@hot*',
                "*@hotad.example.net",
                '*xwell@hot*',
        ]:

            serials = _user_expression_match(user_search,
                                             list(token_user_dict.items()))

            assert 'match' in serials, user_search

        return
    def test_not_matching_expressions(self):
        """ test user search expression not matching"""

        token_owner = "*****@*****.**"
        token_user_dict = {'match': token_owner}

        for user_search in [
                'maxwell',
                'maxwell@hotad.*.ned',
                'maxwell@hod*net',
                'maxwell@hod*',
                "*[email protected]",
                '*oxwell@hot*',
        ]:

            serials = _user_expression_match(user_search,
                                             token_user_dict.items())

            assert 'match' not in serials

        return
Beispiel #4
0
    def test_matching_expressions(self):
        """test user search expression matching"""

        token_owner = "*****@*****.**"
        token_user_dict = {'match':token_owner}

        for user_search in [
            'maxwell*',
            'maxwell@hotad.*.net',
            'maxwell@hot*net',
            'maxwell@hot*',
            "*@hotad.example.net",
            '*xwell@hot*',
            ]:

            serials = _user_expression_match(user_search,
                                             token_user_dict.items())

            assert 'match' in serials, user_search

        return
    def test_not_matching_expressions(self):
        """test user search expression not matching"""

        token_owner = "*****@*****.**"
        token_user_dict = {"match": token_owner}

        for user_search in [
            "maxwell",
            "maxwell@hotad.*.ned",
            "maxwell@hod*net",
            "maxwell@hod*",
            "*[email protected]",
            "*oxwell@hot*",
        ]:

            serials = _user_expression_match(
                user_search, list(token_user_dict.items())
            )

            assert "match" not in serials

        return