<reponame>BBVA/MIST
import os
import pytest

from mist.action_run import execute_from_text

EXAMPLE_FILE = "list2dict.mist"

@pytest.mark.asyncio
async def test_list2dict(examples_path):
    with open(os.path.join(examples_path, EXAMPLE_FILE), "r") as f:
        content = f.read()
    
    console = await execute_from_text(content, waitTime=1)
    assert '''{"a": 1, "b": 2, "c": 3}
{"a": 1, "b": 2, "c": 3}\n''' == console

import os
import pytest

from mist.action_run import execute_from_text

EXAMPLE_FILE = "list2dict.mist"

@pytest.mark.asyncio
async def test_list2dict(examples_path):
    with open(os.path.join(examples_path, EXAMPLE_FILE), "r") as f:
        content = f.read()
    
    console = await execute_from_text(content, waitTime=1)
    assert '''{"a": 1, "b": 2, "c": 3}
{"a": 1, "b": 2, "c": 3}\n''' == console
{"a": 1, "b": 2, "c": 3} {"a": 1, "b": 2, "c": 3}\n