move 'wrap_value' test from macros/ to models/
This commit is contained in:
parent
2375392962
commit
38cf570ca4
@ -3,18 +3,18 @@ from hy.models.integer import HyInteger
|
|||||||
from hy.models.list import HyList
|
from hy.models.list import HyList
|
||||||
from hy.models.expression import HyExpression
|
from hy.models.expression import HyExpression
|
||||||
|
|
||||||
from hy.macros import _wrap_value
|
from hy.models import wrap_value
|
||||||
|
|
||||||
|
|
||||||
def test_wrap_long_type():
|
def test_wrap_long_type():
|
||||||
""" Test conversion of integers."""
|
""" Test conversion of integers."""
|
||||||
wrapped = _wrap_value(long_type(0))
|
wrapped = wrap_value(long_type(0))
|
||||||
assert type(wrapped) == HyInteger
|
assert type(wrapped) == HyInteger
|
||||||
|
|
||||||
|
|
||||||
def test_wrap_tuple():
|
def test_wrap_tuple():
|
||||||
""" Test conversion of tuples."""
|
""" Test conversion of tuples."""
|
||||||
wrapped = _wrap_value((HyInteger(0),))
|
wrapped = wrap_value((HyInteger(0),))
|
||||||
assert type(wrapped) == HyList
|
assert type(wrapped) == HyList
|
||||||
assert type(wrapped[0]) == HyInteger
|
assert type(wrapped[0]) == HyInteger
|
||||||
assert wrapped == HyList([HyInteger(0)])
|
assert wrapped == HyList([HyInteger(0)])
|
||||||
@ -22,7 +22,7 @@ def test_wrap_tuple():
|
|||||||
|
|
||||||
def test_wrap_nested_expr():
|
def test_wrap_nested_expr():
|
||||||
""" Test conversion of HyExpressions with embedded non-HyObjects."""
|
""" Test conversion of HyExpressions with embedded non-HyObjects."""
|
||||||
wrapped = _wrap_value(HyExpression([long_type(0)]))
|
wrapped = wrap_value(HyExpression([long_type(0)]))
|
||||||
assert type(wrapped) == HyExpression
|
assert type(wrapped) == HyExpression
|
||||||
assert type(wrapped[0]) == HyInteger
|
assert type(wrapped[0]) == HyInteger
|
||||||
assert wrapped == HyExpression([HyInteger(0)])
|
assert wrapped == HyExpression([HyInteger(0)])
|
Loading…
x
Reference in New Issue
Block a user