File tree Expand file tree Collapse file tree 2 files changed +0
-25
lines changed
Expand file tree Collapse file tree 2 files changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,6 @@ def test_html_response():
1616 assert response .headers ["User-Agent" ] == "test agent"
1717
1818
19- def test_meta_required_data ():
20- Meta () # By default, no fields are required.
21-
22- class RequiredMeta (Meta ):
23- required_data = {"some_data" }
24-
25- with pytest .raises (ValueError ):
26- RequiredMeta ()
27-
28- meta = RequiredMeta (some_data = 123 )
29- assert meta ["some_data" ] == 123
30-
31-
3219def test_meta_restriction ():
3320 # Any value that conforms with `Meta.restrictions` raises an error
3421 with pytest .raises (ValueError ) as err :
Original file line number Diff line number Diff line change @@ -41,18 +41,11 @@ class Meta(dict):
4141 functionalities to ensure consistent and compatible Page Objects across
4242 different use cases:
4343
44- * A class variable named ``required_data`` to ensure consistent
45- arguments. If it's instantiated with missing ``keys`` from
46- ``required_data``, then a ``ValueError`` is raised.
47-
4844 * Ensures that some params with data types that are difficult to
4945 provide or pass like ``lambdas`` are checked. Otherwise, a ``ValueError``
5046 is raised.
5147 """
5248
53- # Contains the required "keys" when instantiating and setting attributes.
54- required_data : Set = set ()
55-
5649 # Any "value" that returns True for the functions here are not allowed.
5750 restrictions : Dict = {
5851 inspect .ismodule : "module" ,
@@ -68,11 +61,6 @@ class Meta(dict):
6861 }
6962
7063 def __init__ (self , * args , ** kwargs ) -> None :
71- missing_required_keys = self .required_data - kwargs .keys ()
72- if missing_required_keys :
73- raise ValueError (
74- f"These keys are required for instantiation: { missing_required_keys } "
75- )
7664 for val in kwargs .values ():
7765 self .is_restricted_value (val )
7866 super ().__init__ (* args , ** kwargs )
You can’t perform that action at this time.
0 commit comments