diff options
author | Robert Collins <robertc@robertcollins.net> | 2012-12-18 09:26:24 +1300 |
---|---|---|
committer | Robert Collins <robertc@robertcollins.net> | 2012-12-18 09:26:24 +1300 |
commit | ef5d2af7f2d09d5b7ce8fe632e6773882ad5ac58 (patch) | |
tree | 898122f62089545bb5232c1322826ba06ef6b982 | |
parent | aaae75dc3568ba95d4db5478b1c92eec454356f4 (diff) | |
download | nova-ef5d2af7f2d09d5b7ce8fe632e6773882ad5ac58.tar.gz nova-ef5d2af7f2d09d5b7ce8fe632e6773882ad5ac58.tar.xz nova-ef5d2af7f2d09d5b7ce8fe632e6773882ad5ac58.zip |
Move TimeOverride to the general reusable-test-helper place.
Change-Id: Ife5355252813f9b14d5b3f8b543649b88a92acb9
-rw-r--r-- | nova/test.py | 9 | ||||
-rw-r--r-- | nova/tests/consoleauth/test_consoleauth.py | 12 |
2 files changed, 10 insertions, 11 deletions
diff --git a/nova/test.py b/nova/test.py index baeef49c2..08d426874 100644 --- a/nova/test.py +++ b/nova/test.py @@ -246,3 +246,12 @@ class APICoverage(object): self.assertThat( test_methods, testtools.matchers.ContainsAll(api_methods)) + + +class TimeOverride(fixtures.Fixture): + """Fixture to start and remove time override.""" + + def setUp(self): + super(TimeOverride, self).setUp() + timeutils.set_time_override() + self.addCleanup(timeutils.clear_time_override) diff --git a/nova/tests/consoleauth/test_consoleauth.py b/nova/tests/consoleauth/test_consoleauth.py index 1490028ca..8db72221e 100644 --- a/nova/tests/consoleauth/test_consoleauth.py +++ b/nova/tests/consoleauth/test_consoleauth.py @@ -20,7 +20,6 @@ Tests for Consoleauth Code. """ -import fixtures import time from nova.consoleauth import manager @@ -32,15 +31,6 @@ from nova import test LOG = logging.getLogger(__name__) -class TimeOverride(fixtures.Fixture): - """Fixture to start and remove time override.""" - - def setUp(self): - super(TimeOverride, self).setUp() - timeutils.set_time_override() - self.addCleanup(timeutils.clear_time_override) - - class ConsoleauthTestCase(test.TestCase): """Test Case for consoleauth.""" @@ -51,7 +41,7 @@ class ConsoleauthTestCase(test.TestCase): def test_tokens_expire(self): """Test that tokens expire correctly.""" - self.useFixture(TimeOverride()) + self.useFixture(test.TimeOverride()) token = 'mytok' self.flags(console_token_ttl=1) self.manager.authorize_console(self.context, token, 'novnc', |