I can bind radio
This commit is contained in:
@@ -300,7 +300,7 @@ class TestableElement:
|
||||
self.fields[name] = raw_value
|
||||
elif name not in self.fields:
|
||||
# If no radio is checked yet, don't set a default
|
||||
pass
|
||||
self.fields[name] = None
|
||||
|
||||
elif input_type == 'number':
|
||||
# Number: int or float based on value
|
||||
@@ -1104,6 +1104,9 @@ class TestableRadio(TestableControl):
|
||||
source: The source HTML or BeautifulSoup Tag.
|
||||
"""
|
||||
super().__init__(client, source, "input")
|
||||
nb_radio_buttons = len(self.element.find_all("input", type="radio"))
|
||||
assert nb_radio_buttons > 0, "No radio buttons found."
|
||||
assert nb_radio_buttons < 2, "Only one radio button per name is supported."
|
||||
self._radio_value = self.my_ft.attrs.get('value', '')
|
||||
|
||||
@property
|
||||
@@ -1573,6 +1576,9 @@ class MyTestClient:
|
||||
f"Found {len(remaining)} forms (with the specified fields). Expected exactly 1."
|
||||
)
|
||||
|
||||
def find_input(self, identifier: str) -> TestableInput:
|
||||
pass
|
||||
|
||||
def get_content(self) -> str:
|
||||
"""
|
||||
Get the raw HTML content of the last opened page.
|
||||
|
||||
Reference in New Issue
Block a user