Exemple #1
0
 def test_search_bar_live_display(self):
     test_txt_src = "abcdefghi"
     ent_txts = [
         test_txt_src[i] for i, _ in enumerate(valid_search_filters)
     ]
     n_clicks = 0
     display = search_bar_live_display(n_clicks, *ent_txts)
     truth = [
         f"{valid_search_filters[i]}: {test_txt_src[i]}"
         for i, _ in enumerate(valid_search_filters)
     ]
     truth = ", ".join(truth) + ","
     self.assertEqual(truth.strip(), display.strip())
Exemple #2
0
def search_bar_live_display(example_search_n_clicks, *ent_txts):
    """
    Update the main search bar text live from the example search button and the
    entity fields being typed in.

    Args:
        example_search_n_clicks (int): The number of times the example search
            button was clicked.
        *ent_txts (strs): The strings for each guided search field.

    Returns:
        (str): The text to be shown in the search bar via live update.

    """
    return sl.search_bar_live_display(example_search_n_clicks, *ent_txts)