File tree Expand file tree Collapse file tree 2 files changed +2
-20
lines changed
Expand file tree Collapse file tree 2 files changed +2
-20
lines changed Original file line number Diff line number Diff line change @@ -53,19 +53,6 @@ def get_master(full_table_name: str) -> str:
5353 return match ["master" ] + "`" if match else ""
5454
5555
56- def contains_non_ascii_char (s ):
57- """
58- Check if a string contains non-ASCII characters.
59-
60- :param s: string to check
61- :returns: True if the string contains any non-ASCII characters, False otherwise
62- Example:
63- >>> contains_non_ascii_char("Hello") # returns False
64- >>> contains_non_ascii_char("HelloΣ") # returns True
65- """
66- return any (ord (c ) > 127 for c in s )
67-
68-
6956def is_camel_case (s ):
7057 """
7158 Check if a string is in CamelCase notation.
@@ -76,9 +63,7 @@ def is_camel_case(s):
7663 >>> is_camel_case("TableName") # returns True
7764 >>> is_camel_case("table_name") # returns False
7865 """
79- return re .match (
80- r"^[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)*$" , s
81- ) is not None and not contains_non_ascii_char (s )
66+ return bool (re .match (r"^[A-Z][A-Za-z0-9]*$" , s ))
8267
8368
8469def to_camel_case (s ):
Original file line number Diff line number Diff line change 77 from_camel_case ,
88 to_camel_case ,
99 is_camel_case ,
10- contains_non_ascii_char ,
1110)
1211import pytest
1312
@@ -23,9 +22,7 @@ def test_is_camel_case():
2322 assert not is_camel_case ("hello world" )
2423 assert not is_camel_case ("#baisc_names" )
2524 assert not is_camel_case ("alphaBeta" )
26- non_ascii_class_name = "TestΣ"
27- assert contains_non_ascii_char (non_ascii_class_name )
28- assert not is_camel_case (non_ascii_class_name )
25+ assert not is_camel_case ("TestΣ" )
2926
3027
3128def test_from_camel_case ():
You can’t perform that action at this time.
0 commit comments