Ejemplo n.º 1
0
    def test_revoke_certs_by_user(self, mock_revoke):
        user_id = 'test_user'
        project_id = 2
        file_name = 'test_file'

        def mock_certificate_get_all_by_user(context, user_id):

            return [{"user_id": user_id, "project_id": project_id,
                                          "file_name": file_name}]

        self.stub_out('nova.db.certificate_get_all_by_user',
                      mock_certificate_get_all_by_user)

        crypto.revoke_certs_by_user(user_id)
        mock_revoke.assert_called_once_with(project_id, mock.ANY)
Ejemplo n.º 2
0
    def test_revoke_certs_by_user(self, mock_revoke):
        user_id = 'test_user'
        project_id = 2
        file_name = 'test_file'

        def mock_certificate_get_all_by_user(context, user_id):

            return [{"user_id": user_id, "project_id": project_id,
                                          "file_name": file_name}]

        self.stub_out('nova.db.certificate_get_all_by_user',
                      mock_certificate_get_all_by_user)

        crypto.revoke_certs_by_user(user_id)
        mock_revoke.assert_called_once_with(project_id, mock.ANY)
Ejemplo n.º 3
0
    def test_revoke_certs_by_user(self):
        user_id = "test_user"
        project_id = 2
        file_name = "test_file"

        def mock_certificate_get_all_by_user(context, user_id):

            return [{"user_id": user_id, "project_id": project_id, "file_name": file_name}]

        self.stubs.Set(db, "certificate_get_all_by_user", mock_certificate_get_all_by_user)

        self.mox.StubOutWithMock(crypto, "revoke_cert")
        crypto.revoke_cert(project_id, mox.IgnoreArg())

        self.mox.ReplayAll()

        crypto.revoke_certs_by_user(user_id)
Ejemplo n.º 4
0
    def test_revoke_certs_by_user(self):
        user_id = 'test_user'
        project_id = 2
        file_name = 'test_file'

        def mock_certificate_get_all_by_user(context, user_id):

            return [{"user_id": user_id, "project_id": project_id,
                                          "file_name": file_name}]

        self.stubs.Set(db, 'certificate_get_all_by_user',
                                    mock_certificate_get_all_by_user)

        self.mox.StubOutWithMock(crypto, 'revoke_cert')
        crypto.revoke_cert(project_id, mox.IgnoreArg())

        self.mox.ReplayAll()

        crypto.revoke_certs_by_user(user_id)
Ejemplo n.º 5
0
 def revoke_certs_by_user(self, context, user_id):
     """Revoke all user certs."""
     return crypto.revoke_certs_by_user(user_id)
Ejemplo n.º 6
0
 def revoke_certs_by_user(self, context, user_id):
     """Revoke all user certs."""
     return crypto.revoke_certs_by_user(user_id)