From ecd823d766fecdd7e1c7163073c097a0084122e2 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Fri, 20 Aug 2021 17:50:44 +0100 Subject: [PATCH] Flatten tests/rest/client/{v1,v2_alpha} too (#10667) --- changelog.d/10667.misc | 1 + mypy.ini | 4 ++-- tests/rest/client/{v2_alpha => }/test_account.py | 0 tests/rest/client/{v2_alpha => }/test_auth.py | 2 +- .../rest/client/{v2_alpha => }/test_capabilities.py | 0 tests/rest/client/{v1 => }/test_directory.py | 0 tests/rest/client/{v1 => }/test_events.py | 0 tests/rest/client/{v2_alpha => }/test_filter.py | 0 tests/rest/client/{v2_alpha => }/test_keys.py | 0 tests/rest/client/{v1 => }/test_login.py | 2 +- .../client/{v2_alpha => }/test_password_policy.py | 0 tests/rest/client/{v1 => }/test_presence.py | 0 tests/rest/client/{v1 => }/test_profile.py | 0 tests/rest/client/{v1 => }/test_push_rule_attrs.py | 0 tests/rest/client/{v2_alpha => }/test_register.py | 0 tests/rest/client/{v2_alpha => }/test_relations.py | 0 .../rest/client/{v2_alpha => }/test_report_event.py | 0 tests/rest/client/{v1 => }/test_rooms.py | 0 .../rest/client/{v2_alpha => }/test_sendtodevice.py | 0 .../rest/client/{v2_alpha => }/test_shared_rooms.py | 0 tests/rest/client/{v2_alpha => }/test_sync.py | 0 tests/rest/client/{v1 => }/test_typing.py | 0 .../rest/client/{v2_alpha => }/test_upgrade_room.py | 0 tests/rest/client/{v1 => }/utils.py | 0 tests/rest/client/v1/__init__.py | 13 ------------- tests/rest/client/v2_alpha/__init__.py | 0 tests/unittest.py | 2 +- 27 files changed, 6 insertions(+), 18 deletions(-) create mode 100644 changelog.d/10667.misc rename tests/rest/client/{v2_alpha => }/test_account.py (100%) rename tests/rest/client/{v2_alpha => }/test_auth.py (99%) rename tests/rest/client/{v2_alpha => }/test_capabilities.py (100%) rename tests/rest/client/{v1 => }/test_directory.py (100%) rename tests/rest/client/{v1 => }/test_events.py (100%) rename tests/rest/client/{v2_alpha => }/test_filter.py (100%) rename tests/rest/client/{v2_alpha => }/test_keys.py (100%) rename tests/rest/client/{v1 => }/test_login.py (99%) rename tests/rest/client/{v2_alpha => }/test_password_policy.py (100%) rename tests/rest/client/{v1 => }/test_presence.py (100%) rename tests/rest/client/{v1 => }/test_profile.py (100%) rename tests/rest/client/{v1 => }/test_push_rule_attrs.py (100%) rename tests/rest/client/{v2_alpha => }/test_register.py (100%) rename tests/rest/client/{v2_alpha => }/test_relations.py (100%) rename tests/rest/client/{v2_alpha => }/test_report_event.py (100%) rename tests/rest/client/{v1 => }/test_rooms.py (100%) rename tests/rest/client/{v2_alpha => }/test_sendtodevice.py (100%) rename tests/rest/client/{v2_alpha => }/test_shared_rooms.py (100%) rename tests/rest/client/{v2_alpha => }/test_sync.py (100%) rename tests/rest/client/{v1 => }/test_typing.py (100%) rename tests/rest/client/{v2_alpha => }/test_upgrade_room.py (100%) rename tests/rest/client/{v1 => }/utils.py (100%) delete mode 100644 tests/rest/client/v1/__init__.py delete mode 100644 tests/rest/client/v2_alpha/__init__.py diff --git a/changelog.d/10667.misc b/changelog.d/10667.misc new file mode 100644 index 000000000..c92846ae2 --- /dev/null +++ b/changelog.d/10667.misc @@ -0,0 +1 @@ +Flatten the `tests.synapse.rests` package by moving the contents of `v1` and `v2_alpha` into the parent. \ No newline at end of file diff --git a/mypy.ini b/mypy.ini index 90ade37b3..b17872211 100644 --- a/mypy.ini +++ b/mypy.ini @@ -91,8 +91,8 @@ files = tests/handlers/test_password_providers.py, tests/handlers/test_room_summary.py, tests/handlers/test_sync.py, - tests/rest/client/v1/test_login.py, - tests/rest/client/v2_alpha/test_auth.py, + tests/rest/client/test_login.py, + tests/rest/client/test_auth.py, tests/util/test_itertools.py, tests/util/test_stream_change_cache.py diff --git a/tests/rest/client/v2_alpha/test_account.py b/tests/rest/client/test_account.py similarity index 100% rename from tests/rest/client/v2_alpha/test_account.py rename to tests/rest/client/test_account.py diff --git a/tests/rest/client/v2_alpha/test_auth.py b/tests/rest/client/test_auth.py similarity index 99% rename from tests/rest/client/v2_alpha/test_auth.py rename to tests/rest/client/test_auth.py index cf5cfb910..e2fcbdc63 100644 --- a/tests/rest/client/v2_alpha/test_auth.py +++ b/tests/rest/client/test_auth.py @@ -25,7 +25,7 @@ from synapse.types import JsonDict, UserID from tests import unittest from tests.handlers.test_oidc import HAS_OIDC -from tests.rest.client.v1.utils import TEST_OIDC_CONFIG +from tests.rest.client.utils import TEST_OIDC_CONFIG from tests.server import FakeChannel from tests.unittest import override_config, skip_unless diff --git a/tests/rest/client/v2_alpha/test_capabilities.py b/tests/rest/client/test_capabilities.py similarity index 100% rename from tests/rest/client/v2_alpha/test_capabilities.py rename to tests/rest/client/test_capabilities.py diff --git a/tests/rest/client/v1/test_directory.py b/tests/rest/client/test_directory.py similarity index 100% rename from tests/rest/client/v1/test_directory.py rename to tests/rest/client/test_directory.py diff --git a/tests/rest/client/v1/test_events.py b/tests/rest/client/test_events.py similarity index 100% rename from tests/rest/client/v1/test_events.py rename to tests/rest/client/test_events.py diff --git a/tests/rest/client/v2_alpha/test_filter.py b/tests/rest/client/test_filter.py similarity index 100% rename from tests/rest/client/v2_alpha/test_filter.py rename to tests/rest/client/test_filter.py diff --git a/tests/rest/client/v2_alpha/test_keys.py b/tests/rest/client/test_keys.py similarity index 100% rename from tests/rest/client/v2_alpha/test_keys.py rename to tests/rest/client/test_keys.py diff --git a/tests/rest/client/v1/test_login.py b/tests/rest/client/test_login.py similarity index 99% rename from tests/rest/client/v1/test_login.py rename to tests/rest/client/test_login.py index eba3552b1..5b2243fe5 100644 --- a/tests/rest/client/v1/test_login.py +++ b/tests/rest/client/test_login.py @@ -32,7 +32,7 @@ from synapse.types import create_requester from tests import unittest from tests.handlers.test_oidc import HAS_OIDC from tests.handlers.test_saml import has_saml2 -from tests.rest.client.v1.utils import TEST_OIDC_AUTH_ENDPOINT, TEST_OIDC_CONFIG +from tests.rest.client.utils import TEST_OIDC_AUTH_ENDPOINT, TEST_OIDC_CONFIG from tests.test_utils.html_parsers import TestHtmlParser from tests.unittest import HomeserverTestCase, override_config, skip_unless diff --git a/tests/rest/client/v2_alpha/test_password_policy.py b/tests/rest/client/test_password_policy.py similarity index 100% rename from tests/rest/client/v2_alpha/test_password_policy.py rename to tests/rest/client/test_password_policy.py diff --git a/tests/rest/client/v1/test_presence.py b/tests/rest/client/test_presence.py similarity index 100% rename from tests/rest/client/v1/test_presence.py rename to tests/rest/client/test_presence.py diff --git a/tests/rest/client/v1/test_profile.py b/tests/rest/client/test_profile.py similarity index 100% rename from tests/rest/client/v1/test_profile.py rename to tests/rest/client/test_profile.py diff --git a/tests/rest/client/v1/test_push_rule_attrs.py b/tests/rest/client/test_push_rule_attrs.py similarity index 100% rename from tests/rest/client/v1/test_push_rule_attrs.py rename to tests/rest/client/test_push_rule_attrs.py diff --git a/tests/rest/client/v2_alpha/test_register.py b/tests/rest/client/test_register.py similarity index 100% rename from tests/rest/client/v2_alpha/test_register.py rename to tests/rest/client/test_register.py diff --git a/tests/rest/client/v2_alpha/test_relations.py b/tests/rest/client/test_relations.py similarity index 100% rename from tests/rest/client/v2_alpha/test_relations.py rename to tests/rest/client/test_relations.py diff --git a/tests/rest/client/v2_alpha/test_report_event.py b/tests/rest/client/test_report_event.py similarity index 100% rename from tests/rest/client/v2_alpha/test_report_event.py rename to tests/rest/client/test_report_event.py diff --git a/tests/rest/client/v1/test_rooms.py b/tests/rest/client/test_rooms.py similarity index 100% rename from tests/rest/client/v1/test_rooms.py rename to tests/rest/client/test_rooms.py diff --git a/tests/rest/client/v2_alpha/test_sendtodevice.py b/tests/rest/client/test_sendtodevice.py similarity index 100% rename from tests/rest/client/v2_alpha/test_sendtodevice.py rename to tests/rest/client/test_sendtodevice.py diff --git a/tests/rest/client/v2_alpha/test_shared_rooms.py b/tests/rest/client/test_shared_rooms.py similarity index 100% rename from tests/rest/client/v2_alpha/test_shared_rooms.py rename to tests/rest/client/test_shared_rooms.py diff --git a/tests/rest/client/v2_alpha/test_sync.py b/tests/rest/client/test_sync.py similarity index 100% rename from tests/rest/client/v2_alpha/test_sync.py rename to tests/rest/client/test_sync.py diff --git a/tests/rest/client/v1/test_typing.py b/tests/rest/client/test_typing.py similarity index 100% rename from tests/rest/client/v1/test_typing.py rename to tests/rest/client/test_typing.py diff --git a/tests/rest/client/v2_alpha/test_upgrade_room.py b/tests/rest/client/test_upgrade_room.py similarity index 100% rename from tests/rest/client/v2_alpha/test_upgrade_room.py rename to tests/rest/client/test_upgrade_room.py diff --git a/tests/rest/client/v1/utils.py b/tests/rest/client/utils.py similarity index 100% rename from tests/rest/client/v1/utils.py rename to tests/rest/client/utils.py diff --git a/tests/rest/client/v1/__init__.py b/tests/rest/client/v1/__init__.py deleted file mode 100644 index 5e83dba2e..000000000 --- a/tests/rest/client/v1/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2014-2016 OpenMarket Ltd -# -# 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. diff --git a/tests/rest/client/v2_alpha/__init__.py b/tests/rest/client/v2_alpha/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/unittest.py b/tests/unittest.py index 3eec9c4d5..f2c90cc47 100644 --- a/tests/unittest.py +++ b/tests/unittest.py @@ -252,7 +252,7 @@ class HomeserverTestCase(TestCase): reactor=self.reactor, ) - from tests.rest.client.v1.utils import RestHelper + from tests.rest.client.utils import RestHelper self.helper = RestHelper(self.hs, self.site, getattr(self, "user_id", None))