<commit_before>__author__ = 'jjw'

from sizefs import SizeFS 
from sizefs.contents import SizeFSAlphaNumGen
import unittest


class SizeFSTestCase(unittest.TestCase):

    def test_basic(self):
        # Basic Test

        sfs = SizeFS()
        self.assertEqual(len(sfs.read('/zeros/1B', 1, 0, None)), 1)
        self.assertEqual(len(sfs.read('/ones/1B', 1, 0, None)), 1)
        self.assertEqual(len(sfs.read('/alpha_num/1B', 1, 0, None)), 1)

    def test_contents(self):
        # Contents Test

        sfs = SizeFS()
        self.assertEqual(sfs.read('/zeros/5B', 5, 0, None), '00000')
        self.assertEqual(sfs.read('/ones/5B', 5, 0, None), '11111')
        for ch in sfs.read('/alpha_num/5B', 5, 0, None):
            self.assertTrue(ch in SizeFSAlphaNumGen.chars)

    def test_length(self):
        # Length Test
        k128 = 128*1000
        k256 = 256*1000
        sfs = SizeFS()
        self.assertEqual(len(sfs.read('/zeros/128B', 128, 0, None)), 128)<commit_msg>Minor updates to test_sfs.py to test reading in fs root<commit_after>__author__ = 'jjw'

from sizefs import SizeFS 
from sizefs.contents import SizeFSAlphaNumGen
import unittest


class SizeFSTestCase(unittest.TestCase):

    def test_basic(self):
        # Basic Test
        sfs = SizeFS()
        self.assertEqual(len(sfs.read('/1B', 1, 0, None)), 1)
        self.assertEqual(len(sfs.read('/zeros/1B', 1, 0, None)), 1)
        self.assertEqual(len(sfs.read('/ones/1B', 1, 0, None)), 1)
        self.assertEqual(len(sfs.read('/alpha_num/1B', 1, 0, None)), 1)

    def test_contents(self):
        # Contents Test
        sfs = SizeFS()
        self.assertEqual(sfs.read('/zeros/5B', 5, 0, None), '00000')
        self.assertEqual(sfs.read('/ones/5B', 5, 0, None), '11111')
        for ch in sfs.read('/alpha_num/5B', 5, 0, None):
            self.assertTrue(ch in SizeFSAlphaNumGen.chars)

    def test_length(self):
        # Length Test
        k128 = 128*1000
        k256 = 256*1000
        sfs = SizeFS()
        self.assertEqual(len(sfs.read('/zeros/128B', 128, 0, None)), 128)
{'fraction_non_alphanumeric': 0.14990328820116053, 'fraction_numerical': 0.0609284332688588, 'mean_word_length': 2.6880570409982174, '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': '186045', 'n_tokens_mistral': 821, 'n_tokens_neox': 716, 'n_words': 165}