<commit_before>from luminescence.filesystem.yamlfile import yamlfile

class file_spec():
    
    def should_open_files(self):
        yamlfile("test/fixtures/presentation.yaml")
    
    def should_raise_exception_if_file_does_not_exists(self):
        try:
            yamlfile("test/fixtures/invalid.yaml")
            raise AssertionError("Opened non-existing file")
        except IOError:
            pass
    
    def should_read_file_contents(self):
        f = yamlfile("test/fixtures/presentation.yaml")
        contents = f.contents()
        assert type(contents) == list
        assert len(contents) == 4
        assert "Square" in contents[0]['contents']<commit_msg>Yamlfile tests a bit stronger.<commit_after>from luminescence.filesystem.yamlfile import yamlfile

class file_spec():
    
    def should_open_files(self):
        yamlfile("test/fixtures/presentation.yaml")
    
    def should_raise_exception_if_file_does_not_exists(self):
        try:
            yamlfile("test/fixtures/invalid.yaml")
            raise AssertionError("Opened non-existing file")
        except IOError:
            pass
    
    def should_read_file_contents(self):
        f = yamlfile("test/fixtures/presentation.yaml")
        contents = f.contents()
        assert type(contents) == list
        assert len(contents) == 4
        assert "Square" in contents[0]['contents']
        assert "Circle" in contents[1]['contents']
        assert "Triangle" in contents[2]['contents']
        assert "Pentagon" in contents[3]['contents']
{'fraction_non_alphanumeric': 0.10234680573663625, 'fraction_numerical': 0.0045632333767926985, 'mean_word_length': 2.818407960199005, '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': '5932886', 'n_tokens_mistral': 446, 'n_tokens_neox': 427, 'n_words': 87}