MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / validate_text

Method validate_text

web/pgadmin/utils/csv_lib.py:555–564  ·  view source on GitHub ↗
(dialect, attr)

Source from the content-addressed store, hash-verified

553
554 @staticmethod
555 def validate_text(dialect, attr):
556 val = getattr(dialect, attr)
557 if not isinstance(val, str):
558 if isinstance(val, bytes):
559 raise Error('"{0}" must be string, not bytes'.format(attr))
560 raise Error('"{0}" must be string, not {1}'.format(
561 attr, type(val).__name__))
562
563 if len(val) != 1:
564 raise Error('"{0}" must be a 1-character string'.format(attr))
565
566 @staticmethod
567 def defaults():

Callers 1

validateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected