diff --git a/.testr.conf b/.testr.conf index 2109af6c..818fbc31 100644 --- a/.testr.conf +++ b/.testr.conf @@ -1,4 +1,4 @@ [DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION +test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./ $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/tests/__init__.py b/ceilometerclient/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to ceilometerclient/tests/__init__.py diff --git a/tests/fakes.py b/ceilometerclient/tests/fakes.py similarity index 100% rename from tests/fakes.py rename to ceilometerclient/tests/fakes.py diff --git a/tests/test_http.py b/ceilometerclient/tests/test_http.py similarity index 97% rename from tests/test_http.py rename to ceilometerclient/tests/test_http.py index 3eb5b38d..bc665c39 100644 --- a/tests/test_http.py +++ b/ceilometerclient/tests/test_http.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. -from tests import utils +from ceilometerclient.tests import utils from ceilometerclient.common import http diff --git a/tests/test_shell.py b/ceilometerclient/tests/test_shell.py similarity index 98% rename from tests/test_shell.py rename to ceilometerclient/tests/test_shell.py index 70f62a2e..6c0785b2 100644 --- a/tests/test_shell.py +++ b/ceilometerclient/tests/test_shell.py @@ -10,8 +10,8 @@ from keystoneclient.v2_0 import client as ksclient from ceilometerclient import exc from ceilometerclient import shell as ceilometer_shell +from ceilometerclient.tests import utils from ceilometerclient.v1 import client as v1client -from tests import utils FAKE_ENV = {'OS_USERNAME': 'username', 'OS_PASSWORD': 'password', diff --git a/tests/test_utils.py b/ceilometerclient/tests/test_utils.py similarity index 96% rename from tests/test_utils.py rename to ceilometerclient/tests/test_utils.py index bdb5cf3a..13f0943a 100644 --- a/tests/test_utils.py +++ b/ceilometerclient/tests/test_utils.py @@ -18,7 +18,7 @@ import cStringIO import sys from ceilometerclient.common import utils -from tests import utils as test_utils +from ceilometerclient.tests import utils as test_utils class UtilsTest(test_utils.BaseTestCase): diff --git a/tests/utils.py b/ceilometerclient/tests/utils.py similarity index 100% rename from tests/utils.py rename to ceilometerclient/tests/utils.py diff --git a/tests/v1/__init__.py b/ceilometerclient/tests/v1/__init__.py similarity index 100% rename from tests/v1/__init__.py rename to ceilometerclient/tests/v1/__init__.py diff --git a/tests/v1/test_meters.py b/ceilometerclient/tests/v1/test_meters.py similarity index 99% rename from tests/v1/test_meters.py rename to ceilometerclient/tests/v1/test_meters.py index 5c7e4690..ddd8cb78 100644 --- a/tests/v1/test_meters.py +++ b/ceilometerclient/tests/v1/test_meters.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v1.meters -from tests import utils fixtures = { diff --git a/tests/v1/test_projects.py b/ceilometerclient/tests/v1/test_projects.py similarity index 97% rename from tests/v1/test_projects.py rename to ceilometerclient/tests/v1/test_projects.py index d10125af..97c641f6 100644 --- a/tests/v1/test_projects.py +++ b/ceilometerclient/tests/v1/test_projects.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v1.meters -from tests import utils fixtures = { diff --git a/tests/v1/test_resources.py b/ceilometerclient/tests/v1/test_resources.py similarity index 99% rename from tests/v1/test_resources.py rename to ceilometerclient/tests/v1/test_resources.py index 74217888..33bb4dec 100644 --- a/tests/v1/test_resources.py +++ b/ceilometerclient/tests/v1/test_resources.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v1.meters -from tests import utils fixtures = { diff --git a/tests/v1/test_samples.py b/ceilometerclient/tests/v1/test_samples.py similarity index 99% rename from tests/v1/test_samples.py rename to ceilometerclient/tests/v1/test_samples.py index a5b4af8b..f6eacfd3 100644 --- a/tests/v1/test_samples.py +++ b/ceilometerclient/tests/v1/test_samples.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v1.meters -from tests import utils fixtures = { diff --git a/tests/v1/test_users.py b/ceilometerclient/tests/v1/test_users.py similarity index 97% rename from tests/v1/test_users.py rename to ceilometerclient/tests/v1/test_users.py index f831494e..a6ec55ef 100644 --- a/tests/v1/test_users.py +++ b/ceilometerclient/tests/v1/test_users.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v1.meters -from tests import utils fixtures = { diff --git a/tests/v2/__init__.py b/ceilometerclient/tests/v2/__init__.py similarity index 100% rename from tests/v2/__init__.py rename to ceilometerclient/tests/v2/__init__.py diff --git a/tests/v2/test_alarms.py b/ceilometerclient/tests/v2/test_alarms.py similarity index 97% rename from tests/v2/test_alarms.py rename to ceilometerclient/tests/v2/test_alarms.py index 726434d1..28ae2f37 100644 --- a/tests/v2/test_alarms.py +++ b/ceilometerclient/tests/v2/test_alarms.py @@ -17,10 +17,10 @@ # under the License. import copy -import unittest +import testtools +from ceilometerclient.tests import utils import ceilometerclient.v2.alarms -from tests import utils AN_ALARM = {u'alarm_actions': [u'http://site:8000/alarm'], @@ -94,9 +94,10 @@ fixtures = { } -class AlarmManagerTest(unittest.TestCase): +class AlarmManagerTest(testtools.TestCase): def setUp(self): + super(AlarmManagerTest, self).setUp() self.api = utils.FakeAPI(fixtures) self.mgr = ceilometerclient.v2.alarms.AlarmManager(self.api) diff --git a/tests/v2/test_options.py b/ceilometerclient/tests/v2/test_options.py similarity index 98% rename from tests/v2/test_options.py rename to ceilometerclient/tests/v2/test_options.py index 6b3ef673..0cf7d0c3 100644 --- a/tests/v2/test_options.py +++ b/ceilometerclient/tests/v2/test_options.py @@ -11,8 +11,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils from ceilometerclient.v2 import options -from tests import utils class BuildUrlTest(utils.BaseTestCase): diff --git a/tests/v2/test_resources.py b/ceilometerclient/tests/v2/test_resources.py similarity index 98% rename from tests/v2/test_resources.py rename to ceilometerclient/tests/v2/test_resources.py index eb39c90f..96fbcdea 100644 --- a/tests/v2/test_resources.py +++ b/ceilometerclient/tests/v2/test_resources.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v2.resources -from tests import utils fixtures = { diff --git a/tests/v2/test_samples.py b/ceilometerclient/tests/v2/test_samples.py similarity index 98% rename from tests/v2/test_samples.py rename to ceilometerclient/tests/v2/test_samples.py index 4c6d62db..934644fb 100644 --- a/tests/v2/test_samples.py +++ b/ceilometerclient/tests/v2/test_samples.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v2.samples -from tests import utils base_url = '/v2/meters/instance' diff --git a/tests/v2/test_statistics.py b/ceilometerclient/tests/v2/test_statistics.py similarity index 98% rename from tests/v2/test_statistics.py rename to ceilometerclient/tests/v2/test_statistics.py index e22c19b9..d38bc6e7 100644 --- a/tests/v2/test_statistics.py +++ b/ceilometerclient/tests/v2/test_statistics.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from ceilometerclient.tests import utils import ceilometerclient.v2.statistics -from tests import utils base_url = '/v2/meters/instance/statistics' qry = 'q.op=&q.op=&q.value=foo&q.value=bar&q.field=resource_id&q.field=source'