<commit_before># -*- coding: utf-8 -*-

"""Tests for the 'permissions' plugin.
"""
from __future__ import division, absolute_import, print_function

import os
import platform
from mock import patch, Mock

from test._common import unittest
from test.helper import TestHelper
from beetsplug.permissions import (check_permissions,
                                   convert_perm,
                                   dirs_in_library)


class PermissionsPluginTest(unittest.TestCase, TestHelper):
    def setUp(self):
        self.setup_beets()
        self.load_plugins('permissions')

        self.config['permissions'] = {
            'file': 777,
            'dir': 777}

    def tearDown(self):
        self.teardown_beets()
        self.unload_plugins()

    def test_permissions_on_album_imported(self):
        self.do_thing(True)

    def test_permissions_on_item_imported(self):
        self.config['import']['singletons'] = True
        self.do_thing(True)
<commit_msg>treat default perms as str in permission plugin tests<commit_after># -*- coding: utf-8 -*-

"""Tests for the 'permissions' plugin.
"""
from __future__ import division, absolute_import, print_function

import os
import platform
from mock import patch, Mock

from test._common import unittest
from test.helper import TestHelper
from beetsplug.permissions import (check_permissions,
                                   convert_perm,
                                   dirs_in_library)


class PermissionsPluginTest(unittest.TestCase, TestHelper):
    def setUp(self):
        self.setup_beets()
        self.load_plugins('permissions')

        self.config['permissions'] = {
            'file': '777',
            'dir': '777'}

    def tearDown(self):
        self.teardown_beets()
        self.unload_plugins()

    def test_permissions_on_album_imported(self):
        self.do_thing(True)

    def test_permissions_on_item_imported(self):
        self.config['import']['singletons'] = True
        self.do_thing(True)

{'fraction_non_alphanumeric': 0.09538152610441768, 'fraction_numerical': 0.007028112449799197, 'mean_word_length': 2.6568807339449543, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7025150', 'n_tokens_mistral': 585, 'n_tokens_neox': 557, 'n_words': 130}