rally/tests/unit/plugins/common/context/test_users.py
Anton Studenov c23388003f [Core] Add support for default platform and rally self job
* Added default credentials for all deployments.
* Added Dummy.openstack scenario that allows running
  openstack contexts with dummy scenario.
* Removed openstack users context from samples and jobs
  where it was not required.

Co-Authored-By: Anton Studenov <astudenov@mirantis.com>
Change-Id: I851f2c71e4db25bef17e25c143275e75b16595bf
2017-03-27 20:04:14 +03:00

33 lines
1.1 KiB
Python

# Copyright 2017: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import mock
from rally.plugins.common.context import users
from tests.unit import test
class NoUserTestCase(test.TestCase):
def test_setup(self):
context = {"task": mock.MagicMock(), "config": {}}
users.NoUsers(context).setup()
self.assertIn("users", context)
self.assertEqual([], context["users"])
def test_cleanup(self):
# NOTE(astudenov): Test that cleanup is not abstract
users.NoUsers({"task": mock.MagicMock()}).cleanup()