Merge "Removes use of timeutils.set_time_override"

This commit is contained in:
Jenkins 2014-01-20 05:25:28 +00:00 committed by Gerrit Code Review
commit 9298a2a297
2 changed files with 3 additions and 6 deletions
novaclient/tests

@ -26,7 +26,6 @@ import six
import novaclient.client import novaclient.client
from novaclient import exceptions from novaclient import exceptions
from novaclient.openstack.common import timeutils
import novaclient.shell import novaclient.shell
from novaclient.tests import utils from novaclient.tests import utils
from novaclient.tests.v1_1 import fakes from novaclient.tests.v1_1 import fakes
@ -69,7 +68,6 @@ class ShellTest(utils.TestCase):
self.useFixture(fixtures.MonkeyPatch( self.useFixture(fixtures.MonkeyPatch(
'novaclient.client.get_client_class', 'novaclient.client.get_client_class',
lambda *_: fakes.FakeClient)) lambda *_: fakes.FakeClient))
self.addCleanup(timeutils.clear_time_override)
@mock.patch('sys.stdout', new_callable=six.StringIO) @mock.patch('sys.stdout', new_callable=six.StringIO)
def run_command(self, cmd, mock_stdout): def run_command(self, cmd, mock_stdout):
@ -1076,8 +1074,9 @@ class ShellTest(utils.TestCase):
'end=2005-02-01T00:00:00&' + 'end=2005-02-01T00:00:00&' +
'detailed=1') 'detailed=1')
def test_usage_list_no_args(self): @mock.patch('novaclient.openstack.common.timeutils.utcnow')
timeutils.set_time_override(datetime.datetime(2005, 2, 1, 0, 0)) def test_usage_list_no_args(self, mock_utcnow):
mock_utcnow.return_value = datetime.datetime(2005, 2, 1, 0, 0)
self.run_command('usage-list') self.run_command('usage-list')
self.assert_called('GET', self.assert_called('GET',
'/os-simple-tenant-usage?' + '/os-simple-tenant-usage?' +

@ -20,7 +20,6 @@ import fixtures
import mock import mock
import six import six
from novaclient.openstack.common import timeutils
import novaclient.shell import novaclient.shell
from novaclient.tests import utils from novaclient.tests import utils
from novaclient.tests.v3 import fakes from novaclient.tests.v3 import fakes
@ -62,7 +61,6 @@ class ShellTest(utils.TestCase):
self.useFixture(fixtures.MonkeyPatch( self.useFixture(fixtures.MonkeyPatch(
'novaclient.client.get_client_class', 'novaclient.client.get_client_class',
lambda *_: fakes.FakeClient)) lambda *_: fakes.FakeClient))
self.addCleanup(timeutils.clear_time_override)
@mock.patch('sys.stdout', new_callable=six.StringIO) @mock.patch('sys.stdout', new_callable=six.StringIO)
def run_command(self, cmd, mock_stdout): def run_command(self, cmd, mock_stdout):