Beispiel #1
0
    def test_normal_invalid_first_char_x2(self, value, replace_text, expected):
        sanitized_name = ElasticsearchIndexNameSanitizer(value).sanitize(
            replace_text)

        assert sanitized_name == expected

        ElasticsearchIndexNameSanitizer(sanitized_name).validate()
Beispiel #2
0
    def table_name(self, value):
        from pathvalidate import ElasticsearchIndexNameSanitizer, NullNameError

        try:
            self._table_name = ElasticsearchIndexNameSanitizer(value).sanitize(replacement_text="_")
        except NullNameError:
            self._table_name = None
Beispiel #3
0
 def test_exception_type(self, value, expected):
     with pytest.raises(expected):
         ElasticsearchIndexNameSanitizer(value).validate()