Example #1
0
def test_emits_number():
    assert lua.to_lua(5) == '5'
Example #2
0
def test_emits_variable_assignment():
    assert lua.to_lua(('var', 'value')) == 'var="value"'
Example #3
0
def test_emits_string():
    assert lua.to_lua('python string') == '"python string"'
Example #4
0
def test_emits_dictionary():
    expected = {'some_key': 'some-value', 'other_key': 42}
    for k, v in lua.from_lua('result = ' +
                             lua.to_lua(expected))['result'].items():
        assert expected[k] == v
Example #5
0
def test_emits_number():
    assert lua.to_lua(5) == '5'
Example #6
0
def test_emits_string():
    assert lua.to_lua('python string') == '"python string"'
Example #7
0
def test_emits_variable_assignment():
    assert lua.to_lua(('var', 'value')) == 'var="value"'
Example #8
0
def test_emits_dictionary():
    expected = {'some_key': 'some-value', 'other_key': 42}
    for k, v in lua.from_lua('result = ' + lua.to_lua(expected))['result'].items():
        assert expected[k] == v