(prefix, topic_list)
| 127 | """ |
| 128 | |
| 129 | def __select_random_topic(prefix, topic_list): |
| 130 | # Here we remove the special cases |
| 131 | cleaned_topic_list = [ |
| 132 | x for x in topic_list if "/" not in x and ":" not in x |
| 133 | ] |
| 134 | |
| 135 | # Here we still check that cleaned_topic_list in not empty |
| 136 | if not cleaned_topic_list: |
| 137 | return prefix |
| 138 | |
| 139 | random_topic = random.choice(cleaned_topic_list) |
| 140 | return prefix + random_topic |
| 141 | |
| 142 | if topic.endswith("/:random") or topic.lstrip("/") == ":random": |
| 143 | # We strip the :random part and see if the query is valid by running a get_topics_list() |
nothing calls this directly
no outgoing calls
no test coverage detected