Exemplo n.º 1
0
    def load(cls, sections, log=None, raise_errors=True, prefix=None, also_validate_schema=True):

        dialect_key = IsValidDialect.KEY
        is_database_section = IsDatabaseConnectionSection.load(sections, log, raise_errors, prefix)
        is_valid_path = IsValidPath.load(sections, log, raise_errors=raise_errors)
        is_valid_host = IsValidHost.load(sections, log, raise_errors=raise_errors)
        is_valid_port = IsValidPort.load(sections, log, raise_errors=raise_errors)
        is_valid_username = IsValidUsername.load(sections, log, raise_errors=raise_errors)
        is_valid_password = IsValidPassword.load(sections, log, raise_errors=raise_errors)
        is_valid_database = IsValidDatabase.load(sections, log, raise_errors=raise_errors)
        is_valid_schema = IsValidSchema.load(sections, log, raise_errors=raise_errors)
        return cls(
            sections,
            dialect_key,
            is_database_section,
            is_valid_path,
            is_valid_host,
            is_valid_port,
            is_valid_username,
            is_valid_password,
            is_valid_database,
            is_valid_schema,
            also_validate_schema,
        )
Exemplo n.º 2
0
 def setUp(self):
     self._validate = IsValidSchema.load(self.sections)