<commit_before><commit_msg>add test file<commit_after>from . import Storage, Storable
from .handler import FilesystemHandler

import sqlalchemy as sa
import sqlahelper

Base = sqlahelper.get_base()


class TestFile(Storable, Base):
    __tablename__ = 'TestFile'

    id     = sa.Column(sa.BigInteger(20, unsigned=True), primary_key=True, autoincrement=True)
    foo    = sa.Column(sa.Text(length=32))


class TestStorage():

    test_storage_path = '/tmp/storage_test'
    test_uid = 1000
    test_gid = 100

    storage = None

    def __init__\
        ( self
        , path=None
        , read=True
        , write=True
        , delete=True
        , uid = None
        , gid = None
        , max_lock_time = 2
        ):#{{{

        path = path or self.test_storage_path
        uid = uid or self.test_uid
        gid = gid or self.test_gid

        filesystem_handler = FilesystemHandler\
            ( path
            , uid = uid
            , gid = gid
            , max_lock_time = max_lock_time
            )

        self.storage = Storage()
        self.storage.add_handler('test://', filesystem_handler)
        #}}}

{'fraction_non_alphanumeric': 0.09532215357458076, 'fraction_numerical': 0.01059135039717564, 'mean_word_length': 2.040214477211796, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5966523', 'n_tokens_mistral': 370, 'n_tokens_neox': 345, 'n_words': 78}