def test_client_config_converts(kwargs, stream_type): kwargs[ "commitment_policy"] = CommitmentPolicy.REQUIRE_ENCRYPT_REQUIRE_DECRYPT test = _ClientConfig(**kwargs) assert isinstance(test.source, stream_type) if test.key_provider is not None: assert isinstance(test.materials_manager, DefaultCryptoMaterialsManager)
def test_client_config_converts(kwargs, stream_type): test = _ClientConfig(**kwargs) assert isinstance(test.source, stream_type) if test.key_provider is not None: assert isinstance(test.materials_manager, DefaultCryptoMaterialsManager)
def test_client_config_defaults(): test = _ClientConfig(**BASE_KWARGS) assert test.source_length is None assert test.line_length == LINE_LENGTH
def test_client_config_defaults(): test = _ClientConfig(**BASE_KWARGS) assert test.source_length is None assert test.line_length == LINE_LENGTH assert test.max_encrypted_data_keys is None
def test_attributes_converts(): test = _ClientConfig(source='', key_provider=MagicMock(__class__=MasterKeyProvider)) assert isinstance(test.source, io.BytesIO) assert isinstance(test.materials_manager, DefaultCryptoMaterialsManager) assert test.materials_manager.master_key_provider is test.key_provider
def test_attributes_defaults(): test = _ClientConfig(source='', key_provider=MagicMock(__class__=MasterKeyProvider)) assert test.source_length is None assert test.line_length == LINE_LENGTH
def test_attributes_fail(key_provider, materials_manager, source_length): with pytest.raises(TypeError): _ClientConfig(source='', key_provider=key_provider, materials_manager=materials_manager, source_length=source_length)