Exemple #1
0
    def test_set(self, mock_logging, mock_dss_client):
        handler = CMDSSHandler(uri='test_uri')

        handler.set('a domain', 'a name', 'a value')

        mock_dss_client.return_value.set.assert_called_once_with(
            'a domain', 'a name', 'a value')
Exemple #2
0
    def test_set_dss_fails(self, mock_logging, mock_dss_client):
        handler = CMDSSHandler(uri='test_uri')

        mock_dss_client.return_value.set.side_effect = dss_error.Error(
            'some error')

        with self.assertRaises(CMError) as context:
            handler.set('a domain', 'a name', 'a value')

        mock_dss_client.return_value.set.assert_called_once_with(
            'a domain', 'a name', 'a value')