示例#1
0
    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))
示例#2
0
    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))
示例#3
0
    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)
示例#4
0
    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)