def test_set_property__no_mask(self,mock_mask, mock_mask_name, mock_get, mock_super_set): op = setproperties.MaskedPropertySetter(None, None) op.set_property() mock_get.assert_not_called() mock_super_set.assert_called()
def test_mask_property_name(self): value = MagicMock(spec=str) op = setproperties.MaskedPropertySetter(None, None) op._mask_property_name = value self.assertEqual(op.mask_property_name, value)
def test_set_property__mask_match(self, mock_mask, mock_mask_name, mock_get, mock_super_set): self.mock_hou.patternMatch.return_value = True op = setproperties.MaskedPropertySetter(None, None) op.set_property() mock_get.assert_called_with(mock_mask_name.return_value) self.mock_hou.patternMatch.assert_called_with(mock_mask.return_value, mock_get.return_value) mock_super_set.assert_called()
def test___init__(self, mock_super_init): mock_name = MagicMock(spec=str) mock_block = MagicMock(spec=str) mock_mask = MagicMock(spec=str) op = setproperties.MaskedPropertySetter(mock_name, mock_block, mock_mask) mock_super_init.assert_called_with(mock_name, mock_block) self.assertEqual(op._mask, mock_block["mask"]) self.assertEqual(op._mask_property_name, mock_mask)
def test___init__(self, mocker): mock_super_init = mocker.patch.object(setproperties.PropertySetter, "__init__") mock_name = mocker.MagicMock(spec=str) mock_block = mocker.MagicMock(spec=str) mock_mask = mocker.MagicMock(spec=str) op = setproperties.MaskedPropertySetter(mock_name, mock_block, mock_mask) mock_super_init.assert_called_with(mock_name, mock_block) assert op._mask == mock_block["mask"] assert op._mask_property_name == mock_mask
def _create(): return setproperties.MaskedPropertySetter(None, None, None)