mirror of https://gitlab.com/bashrc2/epicyon
Snake case
parent
f53810e82d
commit
1e84835193
39
tests.py
39
tests.py
|
@ -4613,7 +4613,7 @@ def _test_checkbox_names():
|
||||||
def _test_post_field_names():
|
def _test_post_field_names():
|
||||||
print('testPOSTfieldNames')
|
print('testPOSTfieldNames')
|
||||||
|
|
||||||
fnames = ['fields.get']
|
fnames = ['fields.get', 'actor_json.get']
|
||||||
source_file = 'daemon.py'
|
source_file = 'daemon.py'
|
||||||
source_str = ''
|
source_str = ''
|
||||||
with open(source_file, 'r') as file_source:
|
with open(source_file, 'r') as file_source:
|
||||||
|
@ -4628,6 +4628,9 @@ def _test_post_field_names():
|
||||||
if ')' not in names_list[index]:
|
if ')' not in names_list[index]:
|
||||||
continue
|
continue
|
||||||
param_var_name = names_list[index].split(')')[0].strip()
|
param_var_name = names_list[index].split(')')[0].strip()
|
||||||
|
if '"' not in param_var_name and \
|
||||||
|
"'" not in param_var_name:
|
||||||
|
continue
|
||||||
orig_param_var_name = fname + '(' + param_var_name + ')'
|
orig_param_var_name = fname + '(' + param_var_name + ')'
|
||||||
param_var_name = param_var_name.replace('"', '')
|
param_var_name = param_var_name.replace('"', '')
|
||||||
param_var_name = param_var_name.replace("'", '')
|
param_var_name = param_var_name.replace("'", '')
|
||||||
|
@ -4640,22 +4643,24 @@ def _test_post_field_names():
|
||||||
' should be camel case')
|
' should be camel case')
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
if ' fields[' in source_str:
|
fnames = [' fields[', 'actor_json[']
|
||||||
names_list = source_str.split(' fields[')
|
for fname in fnames:
|
||||||
for index in range(1, len(names_list)):
|
if fname in source_str:
|
||||||
if ']' not in names_list[index]:
|
names_list = source_str.split(fname)
|
||||||
continue
|
for index in range(1, len(names_list)):
|
||||||
param_var_name = names_list[index].split(']')[0].strip()
|
if ']' not in names_list[index]:
|
||||||
if '"' not in param_var_name and \
|
continue
|
||||||
"'" not in param_var_name:
|
param_var_name = names_list[index].split(']')[0].strip()
|
||||||
continue
|
if '"' not in param_var_name and \
|
||||||
orig_param_var_name = 'fields[' + param_var_name + ']'
|
"'" not in param_var_name:
|
||||||
param_var_name = param_var_name.replace('"', '')
|
continue
|
||||||
param_var_name = param_var_name.replace("'", '')
|
orig_param_var_name = fname.strip() + param_var_name + ']'
|
||||||
if '_' in param_var_name:
|
param_var_name = param_var_name.replace('"', '')
|
||||||
print(orig_param_var_name + ' in ' + source_file +
|
param_var_name = param_var_name.replace("'", '')
|
||||||
' should be camel case')
|
if '_' in param_var_name:
|
||||||
assert False
|
print(orig_param_var_name + ' in ' + source_file +
|
||||||
|
' should be camel case')
|
||||||
|
assert False
|
||||||
|
|
||||||
|
|
||||||
def _test_functions():
|
def _test_functions():
|
||||||
|
|
Loading…
Reference in New Issue