hy/tests/importer/test_importer.py

15 lines
431 B
Python
Raw Normal View History

from hy.importer import import_file_to_module, import_buffer_to_ast
2013-04-01 22:13:45 -04:00
import ast
2013-03-03 19:40:46 -05:00
def test_basics():
2013-03-05 22:15:45 -05:00
"Make sure the basics of the importer work"
import_file_to_module("basic",
"tests/resources/importer/basic.hy")
2013-04-01 22:13:45 -04:00
def test_stringer():
"Make sure the basics of the importer work"
_ast = import_buffer_to_ast("(defn square [x] (* x x))", '')
2013-04-01 22:13:45 -04:00
assert type(_ast.body[0]) == ast.FunctionDef