Previously, it was hardcoded at 'compile' time (in as much Python has that). This would make it more difficult to add stuff to it. Also, in a lot of places we made assumptions about prelude instead of checking properly.
32 lines
583 B
Python
32 lines
583 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[0:5]
|
|
assert 5 == len(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
|