Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2022-02-27 21:48:39 -08:00
parent cbf5f4df6d
commit 653d2b21ee
13 changed files with 497 additions and 479 deletions

View File

@ -7,6 +7,7 @@ from .models import FileConversion, ValidOutputFileFormat, ValidSourceFileFormat
from .api.file import post_file_conversion_with_base64_helper
from .api.meta import auth_session, instance_metadata, ping
def test_get_session():
# Create our client.
client = ClientFromEnv()
@ -14,10 +15,11 @@ def test_get_session():
# Get the session.
session: AuthSession = auth_session.sync(client=client)
assert session != None
assert session is not None
print(f"Session: {session}")
@pytest.mark.asyncio
async def test_get_session_async():
# Create our client.
@ -26,10 +28,11 @@ async def test_get_session_async():
# Get the session.
session: AuthSession = await auth_session.asyncio(client=client)
assert session != None
assert session is not None
print(f"Session: {session}")
def test_get_instance():
# Create our client.
client = ClientFromEnv()
@ -37,10 +40,11 @@ def test_get_instance():
# Get the instance.
instance: InstanceMetadata = instance_metadata.sync(client=client)
assert instance != None
assert instance is not None
print(f"Instance: {instance}")
@pytest.mark.asyncio
async def test_get_instance_async():
# Create our client.
@ -49,10 +53,11 @@ async def test_get_instance_async():
# Get the instance.
instance: InstanceMetadata = await instance_metadata.asyncio(client=client)
assert instance != None
assert instance is not None
print(f"Instance: {instance}")
def test_ping():
# Create our client.
client = ClientFromEnv()
@ -60,10 +65,11 @@ def test_ping():
# Get the message.
message: Message = ping.sync(client=client)
assert message != None
assert message is not None
print(f"Message: {message}")
@pytest.mark.asyncio
async def test_ping_async():
# Create our client.
@ -72,10 +78,11 @@ async def test_ping_async():
# Get the message.
message: Message = await ping.asyncio(client=client)
assert message != None
assert message is not None
print(f"Message: {message}")
def test_file_convert_stl():
# Create our client.
client = ClientFromEnv()
@ -86,12 +93,17 @@ def test_file_convert_stl():
file.close()
# Get the fc.
fc: FileConversion = post_file_convertsion_with_base64_helper.sync(client=client, content=content, source_format=ValidSourceFileFormat.STL, output_format=ValidOutputFileFormat.OBJ)
fc: FileConversion = post_file_convertsion_with_base64_helper.sync(
client=client,
content=content,
source_format=ValidSourceFileFormat.STL,
output_format=ValidOutputFileFormat.OBJ)
assert fc != None
assert fc is not None
print(f"FileConversion: {fc}")
@pytest.mark.asyncio
async def test_file_convert_stl_async():
# Create our client.
@ -105,6 +117,6 @@ async def test_file_convert_stl_async():
# Get the fc.
fc: FileConversion = await post_file_convertsion_with_base64_helper.asyncio(client=client, content=content, source_format=ValidSourceFileFormat.STL, output_format=ValidOutputFileFormat.OBJ)
assert fc != None
assert fc is not None
print(f"FileConversion: {fc}")