Skip to content
Permalink
Browse files

Test improvements

  • Loading branch information...
captainhammy committed Sep 8, 2019
1 parent 15fa31e commit ee20342c96e6b01d2c9d2ad1df77e02814ef7642
Showing with 554 additions and 316 deletions.
  1. +0 −40 python/ht/inline/api.py
  2. +0 −24 tests/inline/test_api.py
  3. +554 −252 tests/inline/test_api_integration.py
@@ -805,46 +805,6 @@ def copy_attribute_values(source_element, source_attribs, target_element):
)


def copy_point_attribute_values(target_point, source_point, attributes):
"""Copy attribute values from the source point to the point.
If the attributes do not exist on the destination detail they will be
created.
This function is deprecated. Use copy_attribute_values instead.
:param target_point: The point to copy to.
:type target_point: hou.Point
:param source_point: The point to copy from.
:type source_point: hou.Point
:param attributes: A list of attributes to copy.
:type attributes: list(hou.Attrib)
:return:
"""
copy_attribute_values(source_point, attributes, target_point)


def copy_prim_attribute_values(target_prim, source_prim, attributes):
"""Copy attribute values from the source primitive to the primitive.
If the attributes do not exist on the destination primitive they will be
created.
This function is deprecated. Use copy_attribute_values instead.
:param target_prim: The primitive to copy to.
:type target_prim: hou.Prim
:param source_prim: The primitive to copy from.
:type source_prim: hou.Prim
:param attributes: A list of attributes to copy.
:type attributes: list(hou.Attrib)
:return:
"""
copy_attribute_values(source_prim, attributes, target_prim)


def point_adjacent_polygons(prim):
"""Get all prims that are adjacent to the prim through a point.
@@ -1393,30 +1393,6 @@ def test_geometry(self, mock_read_only, mock_owner_from_type, mock_build, mock_g
len(mock_build.return_value)
)

@patch("ht.inline.api.copy_attribute_values")
def test_copy_point_attribute_values(mock_copy):
"""Test ht.inline.api.copy_point_attribute_values."""
mock_target_point = MagicMock(spec=hou.Point)
mock_source_point = MagicMock(spec=hou.Point)
mock_attributes = MagicMock(spec=str)

api.copy_point_attribute_values(mock_target_point, mock_source_point, mock_attributes)

mock_copy.assert_called_with(mock_source_point, mock_attributes, mock_target_point)


@patch("ht.inline.api.copy_attribute_values")
def test_copy_prim_attribute_values(mock_copy):
"""Test ht.inline.api.copy_prim_attribute_values."""

mock_target_prim = MagicMock(spec=hou.Prim)
mock_source_prim = MagicMock(spec=hou.Prim)
mock_attributes = MagicMock(spec=str)

api.copy_prim_attribute_values(mock_target_prim, mock_source_prim, mock_attributes)

mock_copy.assert_called_with(mock_source_prim, mock_attributes, mock_target_prim)


@patch("ht.inline.api.utils.get_prims_from_list")
@patch("ht.inline.api._cpp_methods.pointAdjacentPolygons")

0 comments on commit ee20342

Please sign in to comment.
You can’t perform that action at this time.