<commit_before>#!/usr/bin/env python

# `fwork.py` will probably be renamed to something a little
# more suggestive as to its purpose.

import unittest
import sys

sys.path.append( '.' )
sys.path.append( '..' )
sys.path.append( '../lib/' )

from  bmark2 import *

class TestBMark2(unittest.TestCase):

    def removeFile(self, file):
        #delete a file if it exists
        if os.path.isfile(file):
            os.system("rm {file}".format(file=file))


    def setUp(self):
        self.foo = 'bar'

    def test_dummy(self):
        assert(1 == 1)

    def test_int(self):
        assert('1' == ascit('1'))

    def test_float(self):
        # Default strict=True removes periods.
        result = ascit('1.0', strict=False)
        assert('1.0' == result)

    def test_remove_period(self):
        assert('10' == ascit('1.0', strict=True))


if __name__ == '__main__':
    unittest.main()<commit_msg>unit testing suffix and csv file test functions<commit_after>#!/usr/bin/env python

# `fwork.py` will probably be renamed to something a little
# more suggestive as to its purpose.

import unittest
import sys

sys.path.append( '.' )
sys.path.append( '..' )
sys.path.append( '../lib/' )

from  bmark2 import *

class TestBMark2(unittest.TestCase):

    def removeFile(self, file):
        #delete a file if it exists
        if os.path.isfile(file):
            os.system("rm {file}".format(file=file))


    def setUp(self):
        self.foo = 'bar'

    def test_get_filename_suffix(self):
        filename = 'foo.bar.csv'
	assert('csv' == get_filename_suffix(filename))
        filename = 'foo.bar.sqlite3'
	assert('sqlite3' == get_filename_suffix(filename))


    def test_is_csv_file(self):
        filename = 'foo.bar.csv'
	assert(True == is_csv_file(filename))
        filename = 'foo.bar.sqlite3'
	assert(False == is_csv_file(filename))

if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.14270668773038442, 'fraction_numerical': 0.010005265929436546, 'mean_word_length': 2.9583333333333335, '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': '71419', 'n_tokens_mistral': 657, 'n_tokens_neox': 631, 'n_words': 152}