mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-13 20:10:46 -05:00
Misc typing fixes for tests, part 1 of N (#11323)
* Annotate HomeserverTestCase.servlets * Correct annotation of federation_auth_origin * Use AnyStr custom_headers instead of a Union This allows (str, str) and (bytes, bytes). This disallows (str, bytes) and (bytes, str) * DomainSpecificString.SIGIL is a ClassVar
This commit is contained in:
parent
95547e5300
commit
4c96ce396e
7 changed files with 53 additions and 29 deletions
|
|
@ -12,7 +12,7 @@
|
|||
# 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.
|
||||
from typing import TYPE_CHECKING
|
||||
from typing import TYPE_CHECKING, Callable
|
||||
|
||||
from synapse.http.server import HttpServer, JsonResource
|
||||
from synapse.rest import admin
|
||||
|
|
@ -62,6 +62,8 @@ from synapse.rest.client import (
|
|||
if TYPE_CHECKING:
|
||||
from synapse.server import HomeServer
|
||||
|
||||
RegisterServletsFunc = Callable[["HomeServer", HttpServer], None]
|
||||
|
||||
|
||||
class ClientRestResource(JsonResource):
|
||||
"""Matrix Client API REST resource.
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from collections import namedtuple
|
|||
from typing import (
|
||||
TYPE_CHECKING,
|
||||
Any,
|
||||
ClassVar,
|
||||
Dict,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
|
|
@ -219,7 +220,7 @@ class DomainSpecificString(metaclass=abc.ABCMeta):
|
|||
'domain' : The domain part of the name
|
||||
"""
|
||||
|
||||
SIGIL: str = abc.abstractproperty() # type: ignore
|
||||
SIGIL: ClassVar[str] = abc.abstractproperty() # type: ignore
|
||||
|
||||
localpart = attr.ib(type=str)
|
||||
domain = attr.ib(type=str)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue