def test_write_new_locked_object(): with pytest.raises(ValueError): with open( os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: wr_bytes = f.read() cert.write_new(wr_bytes, certid=ObjectId.IFX_CERT)
def test_write_new_faulty_objid(): with pytest.raises(TypeError): with open( os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: wr_bytes = f.read() cert.write_new(wr_bytes, certid=0xE0E0)
def test_write_new_faulty_objid(): LOGGER.info('Write new certificate in a fault Certificate Slot') with pytest.raises(TypeError): with open( os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: wr_bytes = f.read() cert.write_new(wr_bytes, certid=0xE0E0)
def test_write_new_faulty_cert(): with pytest.raises(ValueError): with open( os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-faulty-cert.pem'), 'rb') as f: wr_bytes = f.read() cert.write_new(wr_bytes, certid=ObjectId.USER_CERT_1)
def test_write_new_faulty_cert(): LOGGER.info('Try to write an false formated certificate') with pytest.raises(ValueError): with open( os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-faulty-cert.pem'), 'rb') as f: wr_bytes = f.read() cert.write_new(wr_bytes, certid=ObjectId.USER_CERT_1)
def test_write_new_specific(): LOGGER.info('Write new certificate in a specific slot') with open(os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: der_bytes = f.read() cert.write_new(der_bytes, certid=ObjectId.USER_CERT_1)
def test_write_new_default(): LOGGER.info('Write new certificate in a default slot') with open(os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: der_bytes = f.read() cert.write_new(der_bytes)
def test_write_new_specific(): with open(os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: der_bytes = f.read() cert.write_new(der_bytes, certid=ObjectId.USER_CERT_1)
def test_write_new_default(): with open(os.path.join(pytest.test_dir, 'fixtures/test-ec-ecdsa-cert.pem'), 'rb') as f: der_bytes = f.read() cert.write_new(der_bytes)