By annotating types with the constructor application that was used to create them. Later on we can use the router to replace compiler's INSTANCES or for user defined types.
31 lines
535 B
Python
31 lines
535 B
Python
import pytest
|
|
|
|
from ..helpers import Suite
|
|
|
|
|
|
@pytest.mark.integration_test
|
|
def test_bytes_export_constant():
|
|
code_py = """
|
|
CONSTANT: bytes = b'Hello'
|
|
|
|
@exported
|
|
def testEntry() -> bytes:
|
|
return CONSTANT
|
|
"""
|
|
|
|
result = Suite(code_py).run_code()
|
|
|
|
assert b"Hello" == result.returned_value
|
|
|
|
@pytest.mark.integration_test
|
|
def test_bytes_export_instantiation():
|
|
code_py = """
|
|
@exported
|
|
def testEntry() -> bytes:
|
|
return b'Hello'
|
|
"""
|
|
|
|
result = Suite(code_py).run_code()
|
|
|
|
assert b"Hello" == result.returned_value
|