test/keywords/python/string.py
croy 82d417b9e6 New StarlingX Automation Framework
Fresh start for the StarlingX automation framework.

Change-Id: Ie265e0791024f45f71faad6315c2b91b022934d1
2024-11-29 16:01:57 -05:00

19 lines
547 B
Python

class String:
"""
Class for utility methods on the Python str type.
"""
@staticmethod
def is_empty(some_string: str) -> bool:
"""
Checks if 'some_string' is an empty string.
An empty string is either a sequence with zero characters or one that consists only of space characters.
Args:
some_string: the string to be checked.
Returns:
bool: True if 'some_string' is empty, False otherwise.
"""
return not some_string or some_string.strip() == ""