<commit_before>import unittest
from gffutils import helpers
from gffutils import feature


class Test(unittest.TestCase):
    
    def test_merge_attributes(self):
        """
        Tests all possible cases of merging two dictionaries together
        """
        x = {'foo': [1], "baz": 1, "buz": [1], "biz": 1, "boo": [1]}
        y = {'bar': [2], "baz": 2, "buz": [2], "biz": 1, "boo": [1]}
        test = helpers.merge_attributes(x, y)
        true = {'foo': [1],
                'bar': [2],
                "baz": [1, 2],
                "boo": [1],
                "buz": [1, 2],
                "biz": [1]}
        self.assertDictEqual(test, true) 

    def test_merge_Attributes(self):
        f1 = feature.feature_from_line('chr2L . testing 1 10 . + . foo=1; baz=1; buz=1; biz=1; boo=1;', strict=False)
        f2 = feature.feature_from_line('chr2L . testing 1 10 . + . bar=2; baz=2; buz=2; biz=1; boo=1;', strict=False)

        print f1,
        print f1.attributes

        test = helpers.merge_attributes(f1.attributes, f2.attributes)
        true = {'foo': ['1'],
                'bar': ['2'],
                "baz": ['1', '2'],
                "boo": ['1'],
                "buz": ['1', '2'],
                "biz": ['1']}<commit_msg>rm py2 print syntax from test<commit_after>import unittest
from gffutils import helpers
from gffutils import feature


class Test(unittest.TestCase):
    
    def test_merge_attributes(self):
        """
        Tests all possible cases of merging two dictionaries together
        """
        x = {'foo': [1], "baz": 1, "buz": [1], "biz": 1, "boo": [1]}
        y = {'bar': [2], "baz": 2, "buz": [2], "biz": 1, "boo": [1]}
        test = helpers.merge_attributes(x, y)
        true = {'foo': [1],
                'bar': [2],
                "baz": [1, 2],
                "boo": [1],
                "buz": [1, 2],
                "biz": [1]}
        self.assertDictEqual(test, true) 

    def test_merge_Attributes(self):
        f1 = feature.feature_from_line('chr2L . testing 1 10 . + . foo=1; baz=1; buz=1; biz=1; boo=1;', strict=False)
        f2 = feature.feature_from_line('chr2L . testing 1 10 . + . bar=2; baz=2; buz=2; biz=1; boo=1;', strict=False)
        test = helpers.merge_attributes(f1.attributes, f2.attributes)
        true = {'foo': ['1'],
                'bar': ['2'],
                "baz": ['1', '2'],
                "boo": ['1'],
                "buz": ['1', '2'],
                "biz": ['1']}
{'fraction_non_alphanumeric': 0.18785425101214576, 'fraction_numerical': 0.04008097165991903, 'mean_word_length': 1.9036427732079906, 'pattern_counts': {'":': 32, '<': 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': '4772195', 'n_tokens_mistral': 918, 'n_tokens_neox': 840, 'n_words': 222}