def test_replace_space(self, s, expected): actual = StrUtils.replace_spaces(s, pattern='%20') assert actual == expected
def test_is_palindrome(self, s, expected): actual = StrUtils.is_palindrome(s) assert actual is expected
def test_check_permutation(self, s1, s2, expected): actual = StrUtils.is_permutation(s1, s2) assert actual is expected
def test_check_permutation_raise(self, s1, s2): with pytest.raises(ArgError): StrUtils.is_permutation(s1, s2)
def test_is_unique_case_sensitive_char(self, s, expected): actual = StrUtils.is_unique_char(s, case_sensitive=True) assert actual is expected
def test_is_unique_char_raise(self, s): with pytest.raises(ArgError): StrUtils.is_unique_char(s)
def test_is_unique_char(self, s, expected): actual = StrUtils.is_unique_char(s) assert actual is expected
def test_to_bytes_str(self, str_, assert_str): bytes_str = StrUtils.to_bytes(str_) assert isinstance(bytes_str, bytes) assert bytes_str == assert_str
def test_to_utf8_str(self, str_, assert_str): utf8_str = StrUtils.to_str(str_) assert isinstance(utf8_str, str) assert utf8_str == assert_str
def test_lcs(self, s1, s2, expected): actual = StrUtils.lcs(s1, s2) assert actual == expected
def test_substring(self, s, pattern, expected): actual = StrUtils.is_substring(s, pattern) assert actual == expected