<commit_before>__author__ = 'tonycastronova'

from unittest import TestCase

from django.contrib.auth.models import User, Group

from hs_core.models import GenericResource
from hs_core.hydroshare import resource
from hs_core.hydroshare import users

# iRODS mocking has not been used here as we want test bag creation


class TestGetResource(TestCase):
    def setUp(self):
        self.hydroshare_author_group, _ = Group.objects.get_or_create(name='Hydroshare Author')
        # create a user
        self.user = users.create_account(
            '<EMAIL>',
            username='sometestuser',
            first_name='some_first_name',
            last_name='some_last_name',
            superuser=False,
            groups=[])

        self.res = resource.create_resource(
            'GenericResource',
            self.user,
            'My Test Resource'<commit_msg>[#891] stop mocked iRODS patchers for test_get_resource<commit_after>__author__ = 'tonycastronova'

from unittest import TestCase
from mock import patch

from django.contrib.auth.models import User, Group

from hs_core.models import GenericResource
from hs_core.hydroshare import resource
from hs_core.hydroshare import users

# iRODS mocking has not been used here as we want to test bag creation


class TestGetResource(TestCase):
    def setUp(self):
        # stop mocking of iRODS interaction in case those patchers are active
        patch.stopall()

        self.hydroshare_author_group, _ = Group.objects.get_or_create(name='Hydroshare Author')
        # create a user
        self.user = users.create_account(
            '<EMAIL>',
            username='sometestuser',
            first_name='some_first_name',
            last_name='some_last_name',
            superuser=False,
            groups=[])

        self.res = resource.create_resource(
            'GenericResource',
            self.user,
            'My Test Resource'
{'fraction_non_alphanumeric': 0.07571801566579635, 'fraction_numerical': 0.001566579634464752, 'mean_word_length': 2.7790927021696255, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6977788', 'n_tokens_mistral': 544, 'n_tokens_neox': 526, 'n_words': 144}