add in more tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2021-12-15 08:33:25 -08:00
parent 4bb7008d5d
commit a84efd580d
3 changed files with 36 additions and 2 deletions

BIN
assets/testing.stl Normal file

Binary file not shown.

View File

@ -27,7 +27,7 @@ def sync(
client=client,
)
if fc.output != "":
if fc != None and fc.output != "":
fc.output = base64.b64decode(fc.output)
return fc
@ -51,7 +51,7 @@ async def asyncio(
client=client,
)
if fc.output != "":
if fc != None and fc.output != "":
fc.output = base64.b64decode(fc.output)
return fc

View File

@ -1,3 +1,4 @@
import os
import pytest
import asyncio
@ -74,3 +75,36 @@ async def test_ping_async():
assert message != None
print(f"Message: {message}")
def test_file_convert_stl():
# Create our client.
client = AuthenticatedClientFromEnv()
dir_path = os.path.dirname(os.path.realpath(__file__))
file = open(os.path.join(dir_path, "../assets/testing.stl"), "rb")
content = file.read()
file.close()
# Get the fc.
fc: FileConversion = file_convert_with_base64_helper.sync(client=client, content=content, source_format=ValidFileTypes.STL, output_format=ValidFileTypes.OBJ)
assert fc != None
print(f"FileConversion: {fc}")
@pytest.mark.asyncio
async def test_file_convert_stl_async():
# Create our client.
client = AuthenticatedClientFromEnv()
dir_path = os.path.dirname(os.path.realpath(__file__))
file = open(os.path.join(dir_path, "../assets/testing.stl"), "rb")
content = file.read()
file.close()
# Get the fc.
fc: FileConversion = await file_convert_with_base64_helper.asyncio(client=client, content=content, source_format=ValidFileTypes.STL, output_format=ValidFileTypes.OBJ)
assert fc != None
print(f"FileConversion: {fc}")