Пример #1
0
    def test(self):
        mock_aov = MagicMock(spec=manager.AOV)

        mock_group_aov = MagicMock(spec=manager.AOV)

        mock_group = MagicMock(spec=manager.AOVGroup)
        type(mock_group).aovs = PropertyMock(return_value = [mock_group_aov])

        result = manager.flatten_aov_items((mock_aov, mock_group))

        self.assertEqual(result, (mock_aov, mock_group_aov))
Пример #2
0
def test_flatten_aov_items(mocker):
    """Test ht.sohohooks.aovs.manager.flatten_aov_items."""
    mock_aov = mocker.MagicMock(spec=manager.AOV)

    mock_group_aov = mocker.MagicMock(spec=manager.AOV)

    mock_group = mocker.MagicMock(spec=manager.AOVGroup)
    type(mock_group).aovs = mocker.PropertyMock(return_value=[mock_group_aov])

    result = manager.flatten_aov_items((mock_aov, mock_group))

    assert result == (mock_aov, mock_group_aov)