How to use the pathvalidate.validate_sqlite_table_name function in pathvalidate

To help you get started, we’ve selected a few pathvalidate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thombashi / pathvalidate / test / test_sqlite.py View on Github external
def test_exception_reserved_valid(self, value, expected):
        with pytest.raises(expected):
            validate_sqlite_table_name(value)
github thombashi / pathvalidate / test / test_sqlite.py View on Github external
def test_exception_type(self, value, expected):
        with pytest.raises(expected):
            validate_sqlite_table_name(value)
github thombashi / pathvalidate / test / test_sqlite.py View on Github external
def test_normal_utf8(self, value):
        validate_sqlite_table_name(value)
github thombashi / pathvalidate / test / test_sqlite.py View on Github external
def test_exception_invalid_win_char(self, value):
        with pytest.raises(InvalidCharError):
            validate_sqlite_table_name(value)
github thombashi / pathvalidate / test / test_sqlite.py View on Github external
def test_exception_reserved_invalid_name(self, value, expected):
        with pytest.raises(expected):
            validate_sqlite_table_name(value)
github thombashi / pytablereader / pytablereader / _tabledata_sanitizer.py View on Github external
def _validate_table_name(self, table_name):
        try:
            pv.validate_sqlite_table_name(table_name)
        except pv.ValidReservedNameError:
            pass
        except (pv.InvalidReservedNameError, pv.InvalidCharError) as e:
            raise InvalidTableNameError(e)
github thombashi / SimpleSQLite / simplesqlite / loader / interface.py View on Github external
def _sanitize_table_name(self, table_name):
        try:
            pathvalidate.validate_sqlite_table_name(table_name)
            return table_name
        except pathvalidate.ReservedNameError:
            return "{:s}_{:s}".format(table_name, self.format_name)
        except pathvalidate.InvalidCharError as e:
            raise InvalidTableNameError(e)