()
| 82 | |
| 83 | |
| 84 | def test(): |
| 85 | assert _normalize("RestoreSysSetTraceFunc") == "restore_sys_set_trace_func" |
| 86 | assert _normalize("restoreSysSetTraceFunc") == "restore_sys_set_trace_func" |
| 87 | assert _normalize("Restore") == "restore" |
| 88 | matches = find_matches_in_contents( |
| 89 | """ |
| 90 | def CamelCase() |
| 91 | def camelCase() |
| 92 | def ignore() |
| 93 | def ignore_this() |
| 94 | def Camel() |
| 95 | def CamelCaseAnother() |
| 96 | """ |
| 97 | ) |
| 98 | assert matches == ["CamelCase", "camelCase", "Camel", "CamelCaseAnother"] |
| 99 | re_name_to_new_val = load_re_to_new_val( |
| 100 | """ |
| 101 | # Call -- skip |
| 102 | # Call1 -- skip |
| 103 | # Call2 -- skip |
| 104 | # Call3 -- skip |
| 105 | # Call4 -- skip |
| 106 | CustomFramesContainerInit |
| 107 | DictContains |
| 108 | DictItems |
| 109 | DictIterItems |
| 110 | DictIterValues |
| 111 | DictKeys |
| 112 | DictPop |
| 113 | DictValues |
| 114 | """ |
| 115 | ) |
| 116 | assert re_name_to_new_val == { |
| 117 | "\\bDictPop\\b": "dict_pop", |
| 118 | "\\bDictItems\\b": "dict_items", |
| 119 | "\\bDictIterValues\\b": "dict_iter_values", |
| 120 | "\\bDictKeys\\b": "dict_keys", |
| 121 | "\\bDictContains\\b": "dict_contains", |
| 122 | "\\bDictIterItems\\b": "dict_iter_items", |
| 123 | "\\bCustomFramesContainerInit\\b": "custom_frames_container_init", |
| 124 | "\\bDictValues\\b": "dict_values", |
| 125 | } |
| 126 | assert ( |
| 127 | substitute_contents( |
| 128 | re_name_to_new_val, |
| 129 | """ |
| 130 | CustomFramesContainerInit |
| 131 | DictContains |
| 132 | DictItems |
| 133 | DictIterItems |
| 134 | DictIterValues |
| 135 | DictKeys |
| 136 | DictPop |
| 137 | DictValues |
| 138 | """, |
| 139 | ) |
| 140 | == """ |
| 141 | custom_frames_container_init |
nothing calls this directly
no test coverage detected