File tree 2 files changed +2
-20
lines changed
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:
53
53
return match ["master" ] + "`" if match else ""
54
54
55
55
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
-
69
56
def is_camel_case (s ):
70
57
"""
71
58
Check if a string is in CamelCase notation.
@@ -76,9 +63,7 @@ def is_camel_case(s):
76
63
>>> is_camel_case("TableName") # returns True
77
64
>>> is_camel_case("table_name") # returns False
78
65
"""
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 ))
82
67
83
68
84
69
def to_camel_case (s ):
Original file line number Diff line number Diff line change 7
7
from_camel_case ,
8
8
to_camel_case ,
9
9
is_camel_case ,
10
- contains_non_ascii_char ,
11
10
)
12
11
import pytest
13
12
@@ -23,9 +22,7 @@ def test_is_camel_case():
23
22
assert not is_camel_case ("hello world" )
24
23
assert not is_camel_case ("#baisc_names" )
25
24
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Σ" )
29
26
30
27
31
28
def test_from_camel_case ():
You can’t perform that action at this time.
0 commit comments