Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
test: add test for PKCS1OAEP_Cipher with gmpy2 (#3760)
Bowen Lianga34e8cb0bde1
diff --git a/.github/workflows/api-tests.yml b/.github/workflows/api-tests.ymlindex 4c93e4e3a18..2786cf67d37 100644--- a/.github/workflows/api-tests.yml+++ b/.github/workflows/api-tests.yml@@ -57,3 +57,6 @@ jobs:- name: Run Workflowrun: dev/pytest/pytest_workflow.sh++ - name: Run Unit tests+ run: dev/pytest/pytest_unit_tests.shdiff --git a/api/tests/unit_tests/libs/test_rsa.py b/api/tests/unit_tests/libs/test_rsa.pynew file mode 100644index 00000000000..a979b77d70a--- /dev/null+++ b/api/tests/unit_tests/libs/test_rsa.py@@ -0,0 +1,29 @@+import rsa as pyrsa+from Crypto.PublicKey import RSA++from libs import gmpy2_pkcs10aep_cipher+++def test_gmpy2_pkcs10aep_cipher() -> None:+ rsa_key_pair = pyrsa.newkeys(2048)+ public_key = rsa_key_pair[0].save_pkcs1()+ private_key = rsa_key_pair[1].save_pkcs1()++ public_rsa_key = RSA.import_key(public_key)+ public_cipher_rsa2 = gmpy2_pkcs10aep_cipher.new(public_rsa_key)++ private_rsa_key = RSA.import_key(private_key)+ private_cipher_rsa = gmpy2_pkcs10aep_cipher.new(private_rsa_key)++ raw_text = 'raw_text'+ raw_text_bytes = raw_text.encode()++ # RSA encryption by public key and decryption by private key+ encrypted_by_pub_key = public_cipher_rsa2.encrypt(message=raw_text_bytes)+ decrypted_by_pub_key = private_cipher_rsa.decrypt(encrypted_by_pub_key)+ assert decrypted_by_pub_key == raw_text_bytes++ # RSA encryption and decryption by private key+ encrypted_by_private_key = private_cipher_rsa.encrypt(message=raw_text_bytes)+ decrypted_by_private_key = private_cipher_rsa.decrypt(encrypted_by_private_key)+ assert decrypted_by_private_key == raw_text_bytesdiff --git a/dev/pytest/pytest_all_tests.sh b/dev/pytest/pytest_all_tests.shindex ff031a753c9..c4318fb922d 100755--- a/dev/pytest/pytest_all_tests.sh+++ b/dev/pytest/pytest_all_tests.sh@@ -9,3 +9,6 @@ dev/pytest/pytest_tools.sh# Workflowdev/pytest/pytest_workflow.sh++# Unit tests+dev/pytest/pytest_unit_tests.sh\ No newline at end of filediff --git a/dev/pytest/pytest_unit_tests.sh b/dev/pytest/pytest_unit_tests.shnew file mode 100755index 00000000000..2a1421358b6--- /dev/null+++ b/dev/pytest/pytest_unit_tests.sh@@ -0,0 +1,5 @@+#!/bin/bash+set -x++# libs+pytest api/tests/unit_tests/libs