launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #08354
[Merge] lp:~allenap/maas/consolidate-namespace-testing into lp:maas
Gavin Panella has proposed merging lp:~allenap/maas/consolidate-namespace-testing into lp:maas with lp:~allenap/maas/consolidate-namespace-pserv as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~allenap/maas/consolidate-namespace-testing/+merge/108012
Moves the maastesting package to maas.testing, as discussed in https://code.launchpad.net/~jtv/maas/oauth-client-library/+merge/107056/comments/230782.
A separate bin/test.mserv script was needed because otherwise there was no way to exclude the maas.testing package from bin/test.maas; nose's --exclude option is almost useless it seems.
--
https://code.launchpad.net/~allenap/maas/consolidate-namespace-testing/+merge/108012
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/maas/consolidate-namespace-testing into lp:maas.
=== modified file 'MANIFEST.in'
--- MANIFEST.in 2012-03-12 19:28:07 +0000
+++ MANIFEST.in 2012-05-30 16:44:22 +0000
@@ -5,4 +5,4 @@
graft vdenv
prune src/*/testing
prune src/*/tests
-prune src/maastesting
+prune src/maas/testing
=== modified file 'Makefile'
--- Makefile 2012-05-23 16:45:00 +0000
+++ Makefile 2012-05-30 16:44:22 +0000
@@ -17,7 +17,8 @@
build: \
bin/buildout \
bin/database \
- bin/maas bin/test.maas bin/test.maastesting \
+ bin/maas bin/test.maas \
+ bin/test.mserv bin/test.maastesting \
bin/twistd.pserv bin/test.pserv \
bin/twistd.txlongpoll \
bin/py bin/ipy \
@@ -41,6 +42,10 @@
bin/buildout install maas-test
@touch --no-create $@
+bin/test.mserv: bin/buildout buildout.cfg versions.cfg setup.py
+ bin/buildout install mserv-test
+ @touch --no-create $@
+
bin/test.maastesting: bin/buildout buildout.cfg versions.cfg setup.py
bin/buildout install maastesting-test
@touch --no-create $@
@@ -69,8 +74,10 @@
bin/buildout install repl
@touch --no-create bin/py bin/ipy
-test: bin/test.maas bin/test.maastesting bin/test.pserv $(js_enums)
+test: bin/test.maas bin/test.mserv bin/test.maastesting
+test: bin/test.pserv $(js_enums)
bin/test.maas
+ bin/test.mserv
bin/test.maastesting
bin/test.pserv
=== modified file 'buildout.cfg'
--- buildout.cfg 2012-05-30 16:44:22 +0000
+++ buildout.cfg 2012-05-30 16:44:22 +0000
@@ -4,6 +4,7 @@
maas
maas-test
maastesting-test
+ mserv-test
pserv
pserv-test
repl
@@ -125,11 +126,24 @@
test.maas=django.core.management:execute_from_command_line
initialization =
${maas:initialization}
- sys.argv[1:1] = ["test", "--exclude=pserv", "--exclude=maastesting"]
+ sys.argv[1:1] = ["test", "--where=src/maasserver"]
scripts = test.maas
extra-paths =
${maas:extra-paths}
+[mserv-test]
+recipe = zc.recipe.egg
+eggs =
+ ${maas:eggs}
+entry-points =
+ test.mserv=django.core.management:execute_from_command_line
+initialization =
+ ${maas:initialization}
+ sys.argv[1:1] = ["test", "--where=src/metadataserver"]
+scripts = test.mserv
+extra-paths =
+ ${maas:extra-paths}
+
[maastesting-test]
recipe = zc.recipe.egg
eggs =
@@ -137,7 +151,7 @@
entry-points =
test.maastesting=nose.core:TestProgram
initialization =
- sys.argv[1:1] = ["--where=src/maastesting"]
+ sys.argv[1:1] = ["--where=src/maas/testing"]
extra-paths = ${common:extra-paths}
scripts =
test.maastesting
=== modified file 'setup.py'
--- setup.py 2012-05-15 08:13:43 +0000
+++ setup.py 2012-05-30 16:44:22 +0000
@@ -53,7 +53,6 @@
exclude=[
b"*.testing",
b"*.tests",
- b"maastesting",
],
),
package_dir={'': b'src'},
=== modified file 'src/apiclient/tests/test_maas_client.py'
--- src/apiclient/tests/test_maas_client.py 2012-05-24 04:03:05 +0000
+++ src/apiclient/tests/test_maas_client.py 2012-05-30 16:44:22 +0000
@@ -26,8 +26,8 @@
MAASDispatcher,
MAASOAuth,
)
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
class TestHelpers(TestCase):
=== modified file 'src/apiclient/tests/test_multipart.py'
--- src/apiclient/tests/test_multipart.py 2012-05-23 15:45:24 +0000
+++ src/apiclient/tests/test_multipart.py 2012-05-30 16:44:22 +0000
@@ -24,8 +24,8 @@
get_content_type,
make_random_boundary,
)
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from testtools.matchers import EndsWith
=== modified file 'src/maas/development.py'
--- src/maas/development.py 2012-04-25 16:45:57 +0000
+++ src/maas/development.py 2012-05-30 16:44:22 +0000
@@ -33,7 +33,7 @@
# Use our custom test runner, which makes sure that a local database
# cluster is running in the branch.
-TEST_RUNNER = 'maastesting.runner.TestRunner'
+TEST_RUNNER = 'maas.testing.runner.TestRunner'
# Use a fake provisioning server for test/demo purposes.
USE_REAL_PSERV = False
@@ -68,7 +68,7 @@
INSTALLED_APPS += (
'django.contrib.admin',
- 'maastesting',
+ 'maas.testing',
'debug_toolbar',
'django_nose',
)
=== modified file 'src/maas/pserv/power/tests/test_poweraction.py'
--- src/maas/pserv/power/tests/test_poweraction.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/power/tests/test_poweraction.py 2012-05-30 16:44:22 +0000
@@ -23,8 +23,8 @@
PowerActionFail,
UnknownPowerType,
)
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from testtools.matchers import FileContains
=== modified file 'src/maas/pserv/testing/amqpclient.py'
--- src/maas/pserv/testing/amqpclient.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/testing/amqpclient.py 2012-05-30 16:44:22 +0000
@@ -68,7 +68,7 @@
http://readthedocs.org/docs/nose/en/latest/writing_tests.html
"""
- from maastesting import rabbit
+ from maas.testing import rabbit
return rabbit.get_rabbit()
@skip(
=== modified file 'src/maas/pserv/tests/__init__.py'
--- src/maas/pserv/tests/__init__.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/__init__.py 2012-05-30 16:44:22 +0000
@@ -12,7 +12,7 @@
__metaclass__ = type
__all__ = []
-from maastesting.rabbit import stop_rabbit
+from maas.testing.rabbit import stop_rabbit
tearDown = stop_rabbit
=== modified file 'src/maas/pserv/tests/test_api.py'
--- src/maas/pserv/tests/test_api.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_api.py 2012-05-30 16:44:22 +0000
@@ -37,8 +37,8 @@
from maas.pserv.testing.fakeapi import FakeAsynchronousProvisioningAPI
from maas.pserv.testing.fakecobbler import make_fake_cobbler_session
from maas.pserv.testing.realcobbler import RealCobbler
+from maas.testing.factory import factory
from maasserver.utils import map_enum
-from maastesting.factory import factory
from testtools import TestCase
from testtools.deferredruntest import AsynchronousDeferredRunTest
from testtools.matchers import (
=== modified file 'src/maas/pserv/tests/test_cobblercatcher.py'
--- src/maas/pserv/tests/test_cobblercatcher.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_cobblercatcher.py 2012-05-30 16:44:22 +0000
@@ -33,7 +33,7 @@
)
from maas.pserv.testing.realcobbler import RealCobbler
from maas.pserv.utils import deferred
-from maastesting.factory import factory
+from maas.testing.factory import factory
from testtools import TestCase
from testtools.deferredruntest import AsynchronousDeferredRunTest
from twisted.internet.defer import inlineCallbacks
=== modified file 'src/maas/pserv/tests/test_cobblerclient.py'
--- src/maas/pserv/tests/test_cobblerclient.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_cobblerclient.py 2012-05-30 16:44:22 +0000
@@ -27,7 +27,7 @@
)
from maas.pserv.testing.factory import CobblerFakeFactory
from maas.pserv.testing.fakecobbler import log_in_to_fake_cobbler
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
from testtools.deferredruntest import AsynchronousDeferredRunTest
from testtools.testcase import ExpectedException
from twisted.internet.defer import (
=== modified file 'src/maas/pserv/tests/test_cobblersession.py'
--- src/maas/pserv/tests/test_cobblersession.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_cobblersession.py 2012-05-30 16:44:22 +0000
@@ -25,7 +25,7 @@
fake_object_not_found_string,
fake_token,
)
-from maastesting.factory import factory
+from maas.testing.factory import factory
from testtools.content import text_content
from testtools.deferredruntest import (
assert_fails_with,
=== modified file 'src/maas/pserv/tests/test_fakecobbler.py'
--- src/maas/pserv/tests/test_fakecobbler.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_fakecobbler.py 2012-05-30 16:44:22 +0000
@@ -19,7 +19,7 @@
FakeCobbler,
log_in_to_fake_cobbler,
)
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
from testtools.content import text_content
from testtools.deferredruntest import AsynchronousDeferredRunTest
from testtools.testcase import ExpectedException
=== modified file 'src/maas/pserv/tests/test_plugin.py'
--- src/maas/pserv/tests/test_plugin.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_plugin.py 2012-05-30 16:44:22 +0000
@@ -30,8 +30,8 @@
SingleUsernamePasswordChecker,
)
from maas.pserv.testing.fakecobbler import make_fake_cobbler_session
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from testtools.deferredruntest import (
assert_fails_with,
AsynchronousDeferredRunTest,
=== modified file 'src/maas/pserv/tests/test_services.py'
--- src/maas/pserv/tests/test_services.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_services.py 2012-05-30 16:44:22 +0000
@@ -20,8 +20,8 @@
LogService,
OOPSService,
)
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from oops_twisted import OOPSObserver
from testtools.content import content_from_file
from testtools.deferredruntest import AsynchronousDeferredRunTest
=== modified file 'src/maas/pserv/tests/test_tasks.py'
--- src/maas/pserv/tests/test_tasks.py 2012-05-30 16:44:22 +0000
+++ src/maas/pserv/tests/test_tasks.py 2012-05-30 16:44:22 +0000
@@ -18,8 +18,8 @@
power_off,
power_on,
)
-from maastesting.celery import CeleryFixture
-from maastesting.testcase import TestCase
+from maas.testing.celery import CeleryFixture
+from maas.testing.testcase import TestCase
from testresources import FixtureResource
# An arbitrary MAC address. Not using a properly random one here since
=== modified file 'src/maas/settings.py'
--- src/maas/settings.py 2012-05-21 05:58:17 +0000
+++ src/maas/settings.py 2012-05-30 16:44:22 +0000
@@ -274,7 +274,9 @@
# The location of the commissioning script that is executed on nodes as
# part of commissioning. Only override this if you know what you are
# doing.
-COMMISSIONING_SCRIPT = 'etc/maas/commissioning-user-data'
+COMMISSIONING_SCRIPT = os.path.join(
+ os.path.dirname(__file__), os.pardir, os.pardir,
+ "etc", "maas", "commissioning-user-data")
# The duration, in minutes, after which we consider a commissioning node
# to have failed and mark it as FAILED_TESTS.
=== renamed directory 'src/maastesting' => 'src/maas/testing'
=== modified file 'src/maas/testing/djangotestcase.py'
--- src/maastesting/djangotestcase.py 2012-04-25 10:27:57 +0000
+++ src/maas/testing/djangotestcase.py 2012-05-30 16:44:22 +0000
@@ -26,7 +26,7 @@
)
from django.db.models import loading
import django.test
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
import testtools
=== modified file 'src/maas/testing/factory.py'
--- src/maastesting/factory.py 2012-04-25 13:00:38 +0000
+++ src/maas/testing/factory.py 2012-05-30 16:44:22 +0000
@@ -76,7 +76,7 @@
"""Create a file, and write data to it.
Prefer the eponymous convenience wrapper in
- :class:`maastesting.testcase.TestCase`. It creates a temporary
+ :class:`maas.testing.testcase.TestCase`. It creates a temporary
directory and arranges for its eventual cleanup.
:param location: Directory. Use a temporary directory for this, and
=== modified file 'src/maas/testing/testcase.py'
--- src/maastesting/testcase.py 2012-05-23 10:32:25 +0000
+++ src/maas/testing/testcase.py 2012-05-30 16:44:22 +0000
@@ -18,8 +18,8 @@
import unittest
from fixtures import TempDir
-from maastesting.factory import factory
-from maastesting.scenarios import WithScenarios
+from maas.testing.factory import factory
+from maas.testing.scenarios import WithScenarios
from nose.proxy import ResultProxy
from nose.tools import nottest
import testresources
=== modified file 'src/maas/testing/tests/test_celery.py'
--- src/maastesting/tests/test_celery.py 2012-05-23 14:43:16 +0000
+++ src/maas/testing/tests/test_celery.py 2012-05-30 16:44:22 +0000
@@ -17,8 +17,8 @@
from celery import current_app
from celery.decorators import task
from celery.result import EagerResult
-from maastesting.celery import CeleryFixture
-from maastesting.testcase import TestCase
+from maas.testing.celery import CeleryFixture
+from maas.testing.testcase import TestCase
@task()
@@ -64,7 +64,7 @@
tasks = self.celery.tasks
self.assertEqual(2, len(tasks))
self.assertEqual(
- ['maastesting.tests.test_celery.task_add'] * 2,
+ ['maas.testing.tests.test_celery.task_add'] * 2,
[task['task'].name for task in tasks])
self.assertEqual({'x': x, 'y': y}, tasks[0]['kwargs'])
self.assertEqual({'x': z, 'y': t}, tasks[1]['kwargs'])
=== modified file 'src/maas/testing/tests/test_factory.py'
--- src/maastesting/tests/test_factory.py 2012-04-25 12:53:19 +0000
+++ src/maas/testing/tests/test_factory.py 2012-05-30 16:44:22 +0000
@@ -15,8 +15,8 @@
from datetime import datetime
import os.path
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from testtools.matchers import (
FileContains,
FileExists,
=== modified file 'src/maas/testing/tests/test_httpd.py'
--- src/maastesting/tests/test_httpd.py 2012-05-28 20:24:07 +0000
+++ src/maas/testing/tests/test_httpd.py 2012-05-30 16:44:22 +0000
@@ -1,7 +1,7 @@
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-"""Tests for `maastesting.httpd`."""
+"""Tests for `maas.testing.httpd`."""
from __future__ import (
absolute_import,
@@ -21,11 +21,11 @@
from urllib2 import urlopen
from urlparse import urljoin
-from maastesting.httpd import (
+from maas.testing.httpd import (
HTTPServerFixture,
ThreadingHTTPServer,
)
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
from testtools.matchers import FileExists
=== modified file 'src/maas/testing/tests/test_matchers.py'
--- src/maastesting/tests/test_matchers.py 2012-04-30 14:16:33 +0000
+++ src/maas/testing/tests/test_matchers.py 2012-05-30 16:44:22 +0000
@@ -12,9 +12,9 @@
__metaclass__ = type
__all__ = []
-from maastesting.factory import factory
-from maastesting.matchers import ContainsAll
-from maastesting.testcase import TestCase
+from maas.testing.factory import factory
+from maas.testing.matchers import ContainsAll
+from maas.testing.testcase import TestCase
from testtools.matchers import MismatchError
=== modified file 'src/maas/testing/tests/test_scenarios.py'
--- src/maastesting/tests/test_scenarios.py 2012-05-16 14:30:21 +0000
+++ src/maas/testing/tests/test_scenarios.py 2012-05-30 16:44:22 +0000
@@ -1,7 +1,7 @@
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-"""Tests for `maastesting.scenarios`."""
+"""Tests for `maas.testing.scenarios`."""
from __future__ import (
absolute_import,
@@ -14,8 +14,8 @@
import unittest
-from maastesting.scenarios import WithScenarios
-from maastesting.testcase import TestCase
+from maas.testing.scenarios import WithScenarios
+from maas.testing.testcase import TestCase
class TestWithScenarios(TestCase):
=== modified file 'src/maas/testing/tests/test_testcase.py'
--- src/maastesting/tests/test_testcase.py 2012-04-20 11:04:42 +0000
+++ src/maas/testing/tests/test_testcase.py 2012-05-30 16:44:22 +0000
@@ -16,7 +16,7 @@
from shutil import rmtree
from tempfile import mkdtemp
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
from testtools.matchers import (
DirExists,
FileExists,
=== modified file 'src/maas/testing/tests/test_utils.py'
--- src/maastesting/tests/test_utils.py 2012-05-17 10:45:23 +0000
+++ src/maas/testing/tests/test_utils.py 2012-05-30 16:44:22 +0000
@@ -12,8 +12,8 @@
__metaclass__ = type
__all__ = []
-from maastesting.testcase import TestCase
-from maastesting.utils import extract_word_list
+from maas.testing.testcase import TestCase
+from maas.testing.utils import extract_word_list
class TestFunctions(TestCase):
=== modified file 'src/maas/testing/tests/test_yui3.py'
--- src/maastesting/tests/test_yui3.py 2012-05-21 15:55:01 +0000
+++ src/maas/testing/tests/test_yui3.py 2012-05-30 16:44:22 +0000
@@ -12,8 +12,8 @@
__metaclass__ = type
__all__ = []
-from maastesting.testcase import TestCase
-from maastesting.yui3 import (
+from maas.testing.testcase import TestCase
+from maas.testing.yui3 import (
extract_tests,
gen_failed_test_messages,
get_failed_tests_message,
=== modified file 'src/maas/tests/test_maas.py'
--- src/maas/tests/test_maas.py 2012-04-20 12:54:26 +0000
+++ src/maas/tests/test_maas.py 2012-05-30 16:44:22 +0000
@@ -25,8 +25,8 @@
import_local_settings,
import_settings,
)
-from maastesting.djangotestcase import DjangoTestCase
-from maastesting.factory import factory
+from maas.testing.djangotestcase import DjangoTestCase
+from maas.testing.factory import factory
class TestSettingsHelpers(DjangoTestCase):
=== modified file 'src/maas/utils/tests/test_jsenums.py'
--- src/maas/utils/tests/test_jsenums.py 2012-05-09 13:03:02 +0000
+++ src/maas/utils/tests/test_jsenums.py 2012-05-30 16:44:22 +0000
@@ -14,6 +14,7 @@
from inspect import getsourcefile
+from maas.testing.testcase import TestCase
from maas.utils.jsenums import (
dump,
footer,
@@ -22,7 +23,6 @@
serialize_enum,
)
from maasserver.utils import map_enum
-from maastesting.testcase import TestCase
class ENUM:
=== modified file 'src/maasserver/testing/factory.py'
--- src/maasserver/testing/factory.py 2012-05-23 16:32:15 +0000
+++ src/maasserver/testing/factory.py 2012-05-30 16:44:22 +0000
@@ -19,6 +19,7 @@
import time
from django.contrib.auth.models import User
+import maas.testing.factory
from maasserver.enum import (
ARCHITECTURE,
NODE_STATUS,
@@ -35,7 +36,6 @@
reload_object,
)
from maasserver.utils import map_enum
-import maastesting.factory
from metadataserver.models import NodeCommissionResult
# We have a limited number of public keys:
@@ -46,7 +46,7 @@
ALL_NODE_STATES = map_enum(NODE_STATUS).values()
-class Factory(maastesting.factory.Factory):
+class Factory(maas.testing.factory.Factory):
def getRandomEnum(self, enum):
"""Pick a random item from an enumeration class.
=== modified file 'src/maasserver/testing/rabbit.py'
--- src/maasserver/testing/rabbit.py 2012-05-22 12:27:18 +0000
+++ src/maasserver/testing/rabbit.py 2012-05-30 16:44:22 +0000
@@ -19,7 +19,7 @@
from functools import wraps
from fixtures import Fixture
-from maastesting.rabbit import get_rabbit
+from maas.testing.rabbit import get_rabbit
from testtools.monkey import MonkeyPatcher
=== modified file 'src/maasserver/testing/testcase.py'
--- src/maasserver/testing/testcase.py 2012-04-19 15:48:46 +0000
+++ src/maasserver/testing/testcase.py 2012-05-30 16:44:22 +0000
@@ -18,12 +18,12 @@
]
from django.core.cache import cache
+import maas.testing.djangotestcase
from maasserver.testing import reset_fake_provisioning_api_proxy
from maasserver.testing.factory import factory
-import maastesting.djangotestcase
-
-
-class TestCase(maastesting.djangotestcase.DjangoTestCase):
+
+
+class TestCase(maas.testing.djangotestcase.DjangoTestCase):
def setUp(self):
super(TestCase, self).setUp()
@@ -32,7 +32,7 @@
class TestModelTestCase(TestCase,
- maastesting.djangotestcase.TestModelTestCase):
+ maas.testing.djangotestcase.TestModelTestCase):
pass
=== modified file 'src/maasserver/testing/tests/test_factory.py'
--- src/maasserver/testing/tests/test_factory.py 2012-04-16 10:00:51 +0000
+++ src/maasserver/testing/tests/test_factory.py 2012-05-30 16:44:22 +0000
@@ -14,8 +14,8 @@
from random import randint
+from maas.testing.testcase import TestCase
from maasserver.testing.factory import factory
-from maastesting.testcase import TestCase
class TestFactory(TestCase):
=== modified file 'src/maasserver/testing/tests/test_rabbit.py'
--- src/maasserver/testing/tests/test_rabbit.py 2012-05-22 12:27:18 +0000
+++ src/maasserver/testing/tests/test_rabbit.py 2012-05-30 16:44:22 +0000
@@ -1,7 +1,7 @@
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
-"""Tests for `maastesting.rabbit`."""
+"""Tests for `maas.testing.rabbit`."""
from __future__ import (
absolute_import,
@@ -13,9 +13,9 @@
__all__ = []
from django.conf import settings
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from maasserver.testing.rabbit import RabbitServerSettings
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
from rabbitfixture.server import RabbitServerResources
=== modified file 'src/maasserver/tests/test_api.py'
--- src/maasserver/tests/test_api.py 2012-05-30 16:44:22 +0000
+++ src/maasserver/tests/test_api.py 2012-05-30 16:44:22 +0000
@@ -34,6 +34,7 @@
from django.http import QueryDict
from fixtures import Fixture
from maas.pserv.enum import POWER_TYPE
+from maas.testing.djangotestcase import TransactionTestCase
from maasserver import api
from maasserver.api import (
EDITABLE_NODE_FIELDS,
@@ -68,7 +69,6 @@
TestCase,
)
from maasserver.utils import map_enum
-from maastesting.djangotestcase import TransactionTestCase
from metadataserver.models import (
NodeKey,
NodeUserData,
=== modified file 'src/maasserver/tests/test_api_mechanism.py'
--- src/maasserver/tests/test_api_mechanism.py 2012-04-30 07:31:02 +0000
+++ src/maasserver/tests/test_api_mechanism.py 2012-05-30 16:44:22 +0000
@@ -14,13 +14,12 @@
__metaclass__ = type
__all__ = []
-from maastesting.testcase import TestCase
-from maasserver.testing.factory import factory
-
+from maas.testing.testcase import TestCase
from maasserver.api import (
api_exported,
dispatch_methods,
)
+from maasserver.testing.factory import factory
class TestApiExported(TestCase):
=== modified file 'src/maasserver/tests/test_commands.py'
--- src/maasserver/tests/test_commands.py 2012-04-19 15:48:46 +0000
+++ src/maasserver/tests/test_commands.py 2012-05-30 16:44:22 +0000
@@ -20,9 +20,9 @@
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.management import call_command
+from maas.testing.djangotestcase import DjangoTestCase
from maasserver.models import FileStorage
from maasserver.testing.factory import factory
-from maastesting.djangotestcase import DjangoTestCase
class TestCommands(DjangoTestCase):
=== modified file 'src/maasserver/tests/test_commands_reconcile.py'
--- src/maasserver/tests/test_commands_reconcile.py 2012-05-22 12:27:18 +0000
+++ src/maasserver/tests/test_commands_reconcile.py 2012-05-30 16:44:22 +0000
@@ -12,10 +12,10 @@
__metaclass__ = type
__all__ = []
+from maas.testing.testcase import TestCase
from maasserver.management.commands.reconcile import (
guess_architecture_from_profile,
)
-from maastesting.testcase import TestCase
class TestFunctions(TestCase):
=== modified file 'src/maasserver/tests/test_exceptions.py'
--- src/maasserver/tests/test_exceptions.py 2012-04-27 12:38:18 +0000
+++ src/maasserver/tests/test_exceptions.py 2012-05-30 16:44:22 +0000
@@ -14,13 +14,13 @@
import httplib
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from maasserver.exceptions import (
MAASAPIBadRequest,
Redirect,
)
from maasserver.testing import extract_redirect
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
class TestExceptions(TestCase):
=== modified file 'src/maasserver/tests/test_js.py'
--- src/maasserver/tests/test_js.py 2012-05-28 19:50:46 +0000
+++ src/maasserver/tests/test_js.py 2012-05-30 16:44:22 +0000
@@ -19,17 +19,22 @@
from glob import glob
import json
import os
-from os.path import abspath
+from os.path import (
+ abspath,
+ dirname,
+ join,
+ pardir,
+ )
from urlparse import urljoin
-from maastesting import yui3
-from maastesting.fixtures import (
+from maas.testing import yui3
+from maas.testing.fixtures import (
DisplayFixture,
SSTFixture,
)
-from maastesting.httpd import HTTPServerFixture
-from maastesting.testcase import TestCase
-from maastesting.utils import extract_word_list
+from maas.testing.httpd import HTTPServerFixture
+from maas.testing.testcase import TestCase
+from maas.testing.utils import extract_word_list
from nose.tools import nottest
from saucelabsfixture import (
SauceConnectFixture,
@@ -107,7 +112,10 @@
__metaclass__ = ABCMeta
- test_paths = glob("src/maasserver/static/js/tests/*.html")
+ test_dir = join(
+ dirname(__file__), pardir, pardir, pardir,
+ "src", "maasserver", "static", "js", "tests")
+ test_paths = glob(join(test_dir, "*.html"))
assert test_paths != [], "No JavaScript unit test pages found."
# Indicates if this test has been cloned.
=== modified file 'src/maasserver/tests/test_maasavahi.py'
--- src/maasserver/tests/test_maasavahi.py 2012-05-01 05:21:58 +0000
+++ src/maasserver/tests/test_maasavahi.py 2012-05-30 16:44:22 +0000
@@ -14,13 +14,13 @@
from collections import defaultdict
+from maas.testing.djangotestcase import DjangoTestCase
import maasserver.maasavahi
from maasserver.maasavahi import (
MAASAvahiService,
setup_maas_avahi_service,
)
from maasserver.models import Config
-from maastesting.djangotestcase import DjangoTestCase
class MockZeroconfServiceFactory:
=== modified file 'src/maasserver/tests/test_models.py'
--- src/maasserver/tests/test_models.py 2012-05-30 16:44:22 +0000
+++ src/maasserver/tests/test_models.py 2012-05-30 16:44:22 +0000
@@ -25,6 +25,11 @@
)
from django.db import transaction
from maas.pserv.enum import POWER_TYPE
+from maas.testing.celery import CeleryFixture
+from maas.testing.djangotestcase import (
+ TestModelTransactionalTestCase,
+ TransactionTestCase,
+ )
from maasserver.enum import (
NODE_PERMISSION,
NODE_STATUS,
@@ -57,11 +62,6 @@
)
from maasserver.tests.models import TimestampedModelTestModel
from maasserver.utils import map_enum
-from maastesting.celery import CeleryFixture
-from maastesting.djangotestcase import (
- TestModelTransactionalTestCase,
- TransactionTestCase,
- )
from metadataserver.models import (
NodeCommissionResult,
NodeUserData,
=== modified file 'src/maasserver/tests/test_node_action.py'
--- src/maasserver/tests/test_node_action.py 2012-05-30 16:44:22 +0000
+++ src/maasserver/tests/test_node_action.py 2012-05-30 16:44:22 +0000
@@ -16,6 +16,7 @@
from django.core.urlresolvers import reverse
from maas.pserv.enum import POWER_TYPE
+from maas.testing.celery import CeleryFixture
from maasserver.enum import (
NODE_PERMISSION,
NODE_STATUS,
@@ -32,7 +33,6 @@
)
from maasserver.testing.factory import factory
from maasserver.testing.testcase import TestCase
-from maastesting.celery import CeleryFixture
ALL_STATUSES = NODE_STATUS_CHOICES_DICT.keys()
=== modified file 'src/maasserver/tests/test_power_parameters.py'
--- src/maasserver/tests/test_power_parameters.py 2012-05-30 16:44:22 +0000
+++ src/maasserver/tests/test_power_parameters.py 2012-05-30 16:44:22 +0000
@@ -16,6 +16,7 @@
from django.core.exceptions import ValidationError
from maas.pserv.enum import POWER_TYPE
+from maas.testing.matchers import ContainsAll
from maasserver.power_parameters import (
POWER_TYPE_PARAMETERS,
PowerParameter,
@@ -24,7 +25,6 @@
from maasserver.testing.factory import factory
from maasserver.testing.testcase import TestCase
from maasserver.utils import map_enum
-from maastesting.matchers import ContainsAll
from testtools.matchers import (
AllMatch,
IsInstance,
=== modified file 'src/maasserver/tests/test_rabbit.py'
--- src/maasserver/tests/test_rabbit.py 2012-05-22 12:27:18 +0000
+++ src/maasserver/tests/test_rabbit.py 2012-05-30 16:44:22 +0000
@@ -18,6 +18,7 @@
from amqplib import client_0_8 as amqp
from django.conf import settings
+from maas.testing.testcase import TestCase
from maasserver.exceptions import NoRabbit
from maasserver.rabbit import (
RabbitBase,
@@ -31,7 +32,6 @@
get_rabbit,
uses_rabbit_fixture,
)
-from maastesting.testcase import TestCase
from testtools.testcase import ExpectedException
=== modified file 'src/maasserver/tests/test_utils.py'
--- src/maasserver/tests/test_utils.py 2012-04-30 16:26:38 +0000
+++ src/maasserver/tests/test_utils.py 2012-05-30 16:44:22 +0000
@@ -12,8 +12,8 @@
__metaclass__ = type
__all__ = []
+from maas.testing.testcase import TestCase
from maasserver.utils import map_enum
-from maastesting.testcase import TestCase
class TestEnum(TestCase):
=== modified file 'src/maasserver/tests/test_views.py'
--- src/maasserver/tests/test_views.py 2012-05-30 16:44:22 +0000
+++ src/maasserver/tests/test_views.py 2012-05-30 16:44:22 +0000
@@ -23,6 +23,7 @@
from django.utils.html import escape
from lxml.html import fromstring
from maas.pserv.enum import PSERV_FAULT
+from maas.testing.matchers import ContainsAll
from maasserver import components
from maasserver.components import register_persistent_error
from maasserver.exceptions import ExternalComponentException
@@ -35,7 +36,6 @@
from maasserver.utils import map_enum
from maasserver.views import HelpfulDeleteView
from maasserver.views.nodes import NodeEdit
-from maastesting.matchers import ContainsAll
class Test404500(LoggedInTestCase):
=== modified file 'src/maasserver/tests/test_views_nodes.py'
--- src/maasserver/tests/test_views_nodes.py 2012-05-30 16:44:22 +0000
+++ src/maasserver/tests/test_views_nodes.py 2012-05-30 16:44:22 +0000
@@ -18,6 +18,7 @@
from django.core.urlresolvers import reverse
from lxml.html import fromstring
from maas.pserv.enum import POWER_TYPE_CHOICES
+from maas.testing.matchers import ContainsAll
from maasserver import messages
import maasserver.api
from maasserver.enum import (
@@ -47,7 +48,6 @@
from maasserver.utils import map_enum
from maasserver.views import nodes as nodes_views
from maasserver.views.nodes import get_longpoll_context
-from maastesting.matchers import ContainsAll
class NodeViewsTest(LoggedInTestCase):
=== modified file 'src/maasserver/tests/test_zeroconfservice.py'
--- src/maasserver/tests/test_zeroconfservice.py 2012-04-16 10:00:51 +0000
+++ src/maasserver/tests/test_zeroconfservice.py 2012-05-30 16:44:22 +0000
@@ -15,9 +15,9 @@
import itertools
import subprocess
+from maas.testing.factory import factory
+from maas.testing.testcase import TestCase
from maasserver.zeroconfservice import ZeroconfService
-from maastesting.factory import factory
-from maastesting.testcase import TestCase
from testtools.content import text_content
=== modified file 'src/metadataserver/tests/__init__.py'
--- src/metadataserver/tests/__init__.py 2012-04-16 10:00:51 +0000
+++ src/metadataserver/tests/__init__.py 2012-05-30 16:44:22 +0000
@@ -12,7 +12,7 @@
__metaclass__ = type
__all__ = []
-from maastesting.rabbit import stop_rabbit
+from maas.testing.rabbit import stop_rabbit
tearDown = stop_rabbit
=== modified file 'src/metadataserver/tests/test_address.py'
--- src/metadataserver/tests/test_address.py 2012-04-16 10:00:51 +0000
+++ src/metadataserver/tests/test_address.py 2012-05-30 16:44:22 +0000
@@ -14,7 +14,7 @@
from socket import gethostname
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
from metadataserver import address
from testtools.matchers import MatchesRegex
=== modified file 'src/metadataserver/tests/test_api.py'
--- src/metadataserver/tests/test_api.py 2012-05-30 16:44:22 +0000
+++ src/metadataserver/tests/test_api.py 2012-05-30 16:44:22 +0000
@@ -17,6 +17,7 @@
from io import BytesIO
from maas.pserv.testing.factory import ProvisioningFakeFactory
+from maas.testing.djangotestcase import DjangoTestCase
from maasserver.enum import NODE_STATUS
from maasserver.exceptions import Unauthorized
from maasserver.models import SSHKey
@@ -24,7 +25,6 @@
from maasserver.testing import reload_object
from maasserver.testing.factory import factory
from maasserver.testing.oauthclient import OAuthAuthenticatedClient
-from maastesting.djangotestcase import DjangoTestCase
from metadataserver.api import (
check_version,
get_node_for_request,
=== modified file 'src/metadataserver/tests/test_models.py'
--- src/metadataserver/tests/test_models.py 2012-05-08 02:57:56 +0000
+++ src/metadataserver/tests/test_models.py 2012-05-30 16:44:22 +0000
@@ -14,8 +14,8 @@
from django.core.exceptions import ValidationError
from django.http import Http404
+from maas.testing.djangotestcase import DjangoTestCase
from maasserver.testing.factory import factory
-from maastesting.djangotestcase import DjangoTestCase
from metadataserver.models import (
NodeCommissionResult,
NodeKey,
=== modified file 'src/metadataserver/tests/test_nodeinituser.py'
--- src/metadataserver/tests/test_nodeinituser.py 2012-04-16 10:00:51 +0000
+++ src/metadataserver/tests/test_nodeinituser.py 2012-05-30 16:44:22 +0000
@@ -13,8 +13,8 @@
__all__ = []
from django.contrib.auth.models import User
+from maas.testing.testcase import TestCase
from maasserver.models import UserProfile
-from maastesting.testcase import TestCase
from metadataserver.nodeinituser import (
get_node_init_user,
user_name,
=== modified file 'templates/test_module.py'
--- templates/test_module.py 2012-04-16 10:00:51 +0000
+++ templates/test_module.py 2012-05-30 16:44:22 +0000
@@ -12,7 +12,7 @@
__metaclass__ = type
__all__ = []
-from maastesting.testcase import TestCase
+from maas.testing.testcase import TestCase
class TestSomething(TestCase):