<commit_before># coding=UTF8
import pytest

from core import hybra

import datetime

from helpers import filters
from helpers import counters
from helpers import domains

class TestUM:

    def setup(self):
        self.dataMedia = hybra.data( 'news', folder = '', terms = ['yle.json'] )
        self.dataFacebook = hybra.data( 'facebook', folder = '', terms = ['facebook.json'] )

    def test_filter_text( self ):
        pass
<commit_msg>Tests for filter method<commit_after># coding=UTF8
import pytest

from core import hybra

import datetime

from helpers import filters
from helpers import counters
from helpers import domains

class TestUM:

    def setup(self):
        self.dataMedia = hybra.data( 'news', folder = '', terms = ['yle.json'] )
        self.dataFacebook = hybra.data( 'facebook', folder = '', terms = ['facebook.json'] )

        self.dataFacebook = map( lambda x: x, self.dataFacebook )
        self.dataMedia = map( lambda x: x, self.dataMedia )

    def test_filter_text( self ):

        fb = hybra.filter_by( self.dataFacebook, 'text', text = [''] )
        media = hybra.filter_by( self.dataMedia, 'text', text = [''] )

        assert( len(fb) == len(self.dataFacebook) )
        assert( len(media) == len(self.dataMedia) )

        fb = hybra.filter_by( self.dataFacebook, 'text', text = ['Post'] )
        media = hybra.filter_by( self.dataMedia, 'text', text = ['Algoritmi'] )

        assert( len(fb) == 3 )
        assert( len(media) == 1 )

        fb = hybra.filter_by( self.dataFacebook, 'text', text = ['pos'] )
        media = hybra.filter_by( self.dataMedia, 'text', text = ['algorit'] )

        assert( len(fb) == 3)
        assert( len(media) == 1)

        fb = hybra.filter_by( self.dataFacebook, 'text', text = ['pos'], substrings = False )
        media = hybra.filter_by( self.dataMedia, 'text', text = ['algorit'], substrings = False )

        assert( len(fb) == 0 )
        assert( len(media) == 0)

        fb = hybra.filter_by( self.dataFacebook, 'text', text = ['post', 'missing text'] )
        media = hybra.filter_by( self.dataMedia, 'text', text = ['algoritmi', 'missing text'] )

        assert( len(fb) == 0 )
        assert( len(media) == 0)

        fb = hybra.filter_by( self.dataFacebook, 'text', text = ['post', 'missing text'], inclusive = False )
        media = hybra.filter_by( self.dataMedia, 'text', text = ['algoritmi', 'missing text'], inclusive = False )

        assert( len(fb) == 3 )
        assert( len(media) == 1)

    def test_filter_datetime( self ):
        pass

    def test_filter_authors( self ):
        pass

    def test_filter_domain( self ):
        pass

    def test_extract_domains( self ):
        pass

    def test_count_authors( self ):
        pass

    def test_count_domains( self ):
        pass

{'fraction_non_alphanumeric': 0.1407142857142857, 'fraction_numerical': 0.004285714285714286, 'mean_word_length': 2.749665327978581, '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': 11, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5133478', 'n_tokens_mistral': 918, 'n_tokens_neox': 863, 'n_words': 244}