From 507227e0f545f1725bceb6f3e77eeb875bcfcb63 Mon Sep 17 00:00:00 2001 From: Marcel Wilson Date: Thu, 12 Oct 2023 09:17:57 -0500 Subject: [PATCH] fixing #38 - runtime protocol checks --- poetry.lock | 4 ++-- tests/unittest_protocols.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/poetry.lock b/poetry.lock index 8cf5639..d0dde37 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "astroid" @@ -1264,4 +1264,4 @@ test = ["coverage", "pytest"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "8f2732e27358a00b906b4565b2925dfd4a115f52a56202f155fe85c8c4698be9" +content-hash = "5fac81ca47b076bd9eef041cf6e4af51a5b4fa93aa5afc7746d0ecd5c319e6e9" diff --git a/tests/unittest_protocols.py b/tests/unittest_protocols.py index 4a0054f..9022c2c 100644 --- a/tests/unittest_protocols.py +++ b/tests/unittest_protocols.py @@ -1,30 +1,30 @@ -from typing import Protocol +from typing import Protocol, runtime_checkable -from screenpy import Answerable, ErrorKeeper, Forgettable, Performable +from screenpy import Answerable, Describable, ErrorKeeper, Forgettable, Performable from screenpy_selenium import Chainable -class Describable(Protocol): - def describe(self) -> str: - ... - - +@runtime_checkable class Question(Answerable, Describable, Protocol): ... +@runtime_checkable class ErrorQuestion(Answerable, Describable, ErrorKeeper, Protocol): ... +@runtime_checkable class Action(Performable, Describable, Protocol): ... +@runtime_checkable class ChainableAction(Chainable, Performable, Describable, Protocol): ... +@runtime_checkable class Ability(Forgettable, Protocol): ...