Ejemplo n.º 1
0
    def test_edge(self, mocker):
        mock_geometry = mocker.MagicMock(spec=hou.Geometry)
        mock_name = mocker.MagicMock(spec=str)

        result = utils.find_group(mock_geometry, 2, mock_name)

        assert result == mock_geometry.findEdgeGroup.return_value

        mock_geometry.findEdgeGroup.assert_called_with(mock_name)
Ejemplo n.º 2
0
    def test_edge(self):
        mock_geometry = MagicMock(spec=hou.Geometry)
        mock_name = MagicMock(spec=str)

        result = utils.find_group(mock_geometry, 2, mock_name)

        self.assertEqual(result, mock_geometry.findEdgeGroup.return_value)

        mock_geometry.findEdgeGroup.assert_called_with(mock_name)
Ejemplo n.º 3
0
    def test_invalid(self, mocker):
        mock_geometry = mocker.MagicMock(spec=hou.Geometry)
        mock_name = mocker.MagicMock(spec=str)

        with pytest.raises(ValueError):
            utils.find_group(mock_geometry, None, mock_name)
Ejemplo n.º 4
0
    def test_invalid(self):
        mock_geometry = MagicMock(spec=hou.Geometry)
        mock_name = MagicMock(spec=str)

        with self.assertRaises(ValueError):
            utils.find_group(mock_geometry, None, mock_name)