Skip to content

🎥 Make videos programmatically with React

add test for progress request

Alex Fernandeza0a6873e91e2
diff --git a/packages/it-tests/src/monorepo/python-package.test.ts b/packages/it-tests/src/monorepo/python-package.test.ts
index cb7e796200..803e153ef8 100644
--- a/packages/it-tests/src/monorepo/python-package.test.ts
+++ b/packages/it-tests/src/monorepo/python-package.test.ts
@@ -57,16 +57,17 @@ test("Python package should create the same renderMedia payload as normal Lambda
})
).toEqual(removeUndefined(nativeVersion));
});
-/*
-test("PHP package should create the same progress payload as normal Lambda package", async () => {
- execSync("php composer.phar install", {
- cwd: path.join(process.cwd(), "..", "lambda-python"),
- });
- const phpOutput = execSync("phpunit ./src/PHPRenderProgressTest.php", {
- cwd: path.join(process.cwd(), "..", "lambda-python"),
- });
- const output = phpOutput.toString().split("\n");
- const toParse = output[4];
+
+test("Python package should create the same progress payload as normal Lambda package", async () => {
+ const pythonOutput = execSync(
+ "pytest -rP ./tests/test_get_render_progress_client.py",
+ {
+ cwd: path.join(process.cwd(), "..", "lambda-python"),
+ }
+ );
+ const output = pythonOutput.toString().split("\n");
+ console.log(output);
+ const toParse = output[10];
const nativeVersion = LambdaInternals.getRenderProgressPayload({
region: "us-east-1",
functionName: "remotion-render",
@@ -77,7 +78,7 @@ test("PHP package should create the same progress payload as normal Lambda packa
const parsedJson = JSON.parse(jsonOutput);
expect(parsedJson).toEqual({ ...nativeVersion, s3OutputProvider: null });
});
- */
+
const removeUndefined = (data: unknown) => {
return JSON.parse(JSON.stringify(data));
};
diff --git a/packages/lambda-python/README.md b/packages/lambda-python/README.md
index ad9ff9a35f..e21cc79aeb 100644
--- a/packages/lambda-python/README.md
+++ b/packages/lambda-python/README.md
@@ -1,5 +1 @@
-# Example Package
-
-This is a simple example package. You can use
-[Github-flavored Markdown](https://guides.github.com/features/mastering-markdown/)
-to write your content.
+# Remotion Lambda PHP SDK
diff --git a/packages/lambda-python/pyproject.toml b/packages/lambda-python/pyproject.toml
deleted file mode 100644
index b3fca0ee33..0000000000
--- a/packages/lambda-python/pyproject.toml
+++ /dev/null
@@ -1,19 +0,0 @@
-[build-system]
-requires = ["setuptools>=61.0"]
-build-backend = "setuptools.build_meta"
-
-[project]
-name = "lambda-python-remotion"
-version = "0.0.1"
-authors = [
- { name="Jonny Burger", email="[email protected]" },
-]
-description = "Remotion Python Client"
-readme = "README.md"
-requires-python = ">=3.11"
-classifiers = [
-]
-
-[project.urls]
-"Homepage" = "https://remotion.dev/"
-"Bug Tracker" = "https://github.com/remotion-dev/remotion/issues"
\ No newline at end of file
diff --git a/packages/lambda-python/remotion_lambda_sdk/__init__.py b/packages/lambda-python/remotion_lambda_sdk/__init__.py
index 67ed63b7f8..2d37b1ef65 100644
--- a/packages/lambda-python/remotion_lambda_sdk/__init__.py
+++ b/packages/lambda-python/remotion_lambda_sdk/__init__.py
@@ -1,3 +1,4 @@
# pylint: disable-all
from .models import RenderParams, RenderProgress, RenderResponse, RenderProgressParams
from .remotionclient import RemotionClient
+from .version import VERSION
diff --git a/packages/lambda-python/setup.py b/packages/lambda-python/setup.py
new file mode 100644
index 0000000000..1f451a0733
--- /dev/null
+++ b/packages/lambda-python/setup.py
@@ -0,0 +1,20 @@
+import os
+import setuptools
+from remotion_lambda_sdk.version import VERSION
+
+with open(os.path.join(os.path.dirname(__file__), "README.md")) as readme:
+ README = readme.read()
+
+setuptools.setup(
+ name="remotion_lambda_sdk",
+ version=VERSION,
+ author="Johny Burger",
+ author_email="[email protected]",
+ description="Remotion Lambda client",
+ long_description_content_type="text/markdown",
+ url="https://github.com/remotion-dev/remotion/tree/main/packages/lambda-python",
+ classifiers=[
+
+ ],
+ python_requires='>=3.6',
+)
diff --git a/packages/lambda-python/tests/test_get_render_progress_client.py b/packages/lambda-python/tests/test_get_render_progress_client.py
index 479048de20..a6b65cbdb4 100644
--- a/packages/lambda-python/tests/test_get_render_progress_client.py
+++ b/packages/lambda-python/tests/test_get_render_progress_client.py
@@ -1,41 +1,15 @@
from unittest import TestCase
-from remotion_lambda_sdk.models import RenderParams
from remotion_lambda_sdk.remotionclient import RemotionClient
# python -m pip install boto3
class TestRemotionClient(TestCase):
- def test_remotion_construct_request(self):
+ def test_remotionprogress_construct_request(self):
client = RemotionClient(region="us-east-1",
serve_url="testbed",
function_name="remotion-render")
- render_params = RenderParams(
- composition="react-svg",
- data={
- 'hi': 'there'
- },
- )
- self.assertEqual(client.region, "us-east-1")
- self.assertIsNotNone(render_params)
- self.assertIsNotNone(render_params.data)
- print(client.contruct_render_request(render_params=render_params))
-
-
-"""
- def test_remotion_progress_construct_request(self):
- client = RemotionClient(region="us-east-1",
- serve_url="testbed",
- function_name="remotion-render")
- render_params = RenderParams(
- composition="remotion-render",
- data={
- 'hi': 'there'
- },
- )
- self.assertEqual(client.region, "us-east-1")
- self.assertIsNotNone(render_params)
- self.assertIsNotNone(render_params.data)
- """
+ print(client.contruct_render_progress_request(
+ render_id="abcdef", bucket_name="remotion-render"))