def test_activate_wps_URLError(self): mock_wps = mock.MagicMock() mock_endpoint = mock.MagicMock() mock_name = mock.MagicMock() mock_wps.getcapabilities.side_effect = URLError(reason='') self.assertIsNone(activate_wps(mock_wps, mock_endpoint, mock_name))
def test_activate_wps(self): mock_wps = mock.MagicMock() mock_endpoint = mock.MagicMock() mock_name = mock.MagicMock() ret = activate_wps(mock_wps, mock_endpoint, mock_name) mock_wps.getcapabilities.assert_called_once() self.assertEqual(mock_wps, ret)