<commit_before>import sci_parameter_utils.fragment as frag


class TestInputInt:
    def test_create(self):
        name = 'test'
        fmt = "{}"
        elem = frag.TemplateElem.elem_by_type('int',
                                              name,
                                              {}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt

    def test_create_w_fmt(self):
        name = 'test'
        fmt = "{:g}"
        elem = frag.TemplateElem.elem_by_type('int',
                                              name,
                                              {'fmt': fmt}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt<commit_msg>Add tests for all input elements<commit_after>import sci_parameter_utils.fragment as frag


class TestInputInt:
    tstr = 'int'

    def test_create(self):
        name = 'test'
        fmt = "{}"
        elem = frag.TemplateElem.elem_by_type(self.tstr,
                                              name,
                                              {}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt

    def test_create_w_fmt(self):
        name = 'test'
        fmt = "{:g}"
        elem = frag.TemplateElem.elem_by_type(self.tstr,
                                              name,
                                              {'fmt': fmt}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt


class TestInputFloat:
    tstr = 'float'

    def test_create(self):
        name = 'test'
        fmt = "{}"
        elem = frag.TemplateElem.elem_by_type(self.tstr,
                                              name,
                                              {}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt

    def test_create_w_fmt(self):
        name = 'test'
        fmt = "{:g}"
        elem = frag.TemplateElem.elem_by_type(self.tstr,
                                              name,
                                              {'fmt': fmt}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt


class TestInputStr:
    tstr = 'str'

    def test_create(self):
        name = 'test'
        fmt = "{}"
        elem = frag.TemplateElem.elem_by_type(self.tstr,
                                              name,
                                              {}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt

    def test_create_w_fmt(self):
        name = 'test'
        fmt = "{:g}"
        elem = frag.TemplateElem.elem_by_type(self.tstr,
                                              name,
                                              {'fmt': fmt}
                                              )

        assert elem.name == name
        assert elem.fmt == fmt
{'fraction_non_alphanumeric': 0.08265802269043761, 'fraction_numerical': 0.0, 'mean_word_length': 0.7735632183908046, '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': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7023480', 'n_tokens_mistral': 673, 'n_tokens_neox': 647, 'n_words': 150}