Ejemplo n.º 1
0
def test_attributes_fail(encryption_context, frame_length):
    with pytest.raises(TypeError):
        EncryptorConfig(source='',
                        key_provider=MagicMock(__class__=MasterKey),
                        encryption_context=encryption_context,
                        algorithm=MagicMock(__class__=Algorithm),
                        frame_length=frame_length)
Ejemplo n.º 2
0
def test_encryptor_config_defaults():
    test = EncryptorConfig(**BASE_KWARGS)
    assert test.encryption_context == {}
    assert test.algorithm is None
    assert test.frame_length == FRAME_LENGTH
Ejemplo n.º 3
0
def test_attributes_defaults():
    test = EncryptorConfig(source='',
                           key_provider=MagicMock(__class__=MasterKey))
    assert test.encryption_context == {}
    assert test.algorithm is None
    assert test.frame_length == FRAME_LENGTH