(dash_duo)
| 92 | |
| 93 | |
| 94 | def test_rdps001_local_reload(dash_duo): |
| 95 | app = reloadable_app() |
| 96 | dash_duo.start_server(app) |
| 97 | dash_duo.wait_for_text_to_equal("#out", "names: [a, b]; hidden: []") |
| 98 | check_table_names(dash_duo, ["a", "b"]) |
| 99 | |
| 100 | rename_and_hide(dash_duo) |
| 101 | # callback output |
| 102 | dash_duo.wait_for_text_to_equal( |
| 103 | "#out", "names: [{}, b]; hidden: [c1]".format(NEW_NAME) |
| 104 | ) |
| 105 | check_table_names(dash_duo, [NEW_NAME]) |
| 106 | |
| 107 | dash_duo.wait_for_page() |
| 108 | # callback gets persisted values, not the values provided with the layout |
| 109 | dash_duo.wait_for_text_to_equal( |
| 110 | "#out", "names: [{}, b]; hidden: [c1]".format(NEW_NAME) |
| 111 | ) |
| 112 | check_table_names(dash_duo, [NEW_NAME]) |
| 113 | |
| 114 | # new persistence reverts |
| 115 | app.persistence.value = 2 |
| 116 | dash_duo.wait_for_page() |
| 117 | check_table_names(dash_duo, ["a", "b"]) |
| 118 | rename_and_hide(dash_duo, 1, "two", 0) |
| 119 | dash_duo.wait_for_text_to_equal("#out", "names: [a, two]; hidden: [c0]") |
| 120 | check_table_names(dash_duo, ["two"]) |
| 121 | |
| 122 | # put back the old persistence, get the old values |
| 123 | app.persistence.value = 1 |
| 124 | dash_duo.wait_for_page() |
| 125 | dash_duo.wait_for_text_to_equal( |
| 126 | "#out", "names: [{}, b]; hidden: [c1]".format(NEW_NAME) |
| 127 | ) |
| 128 | check_table_names(dash_duo, [NEW_NAME]) |
| 129 | |
| 130 | # falsy persistence disables it |
| 131 | app.persistence.value = 0 |
| 132 | dash_duo.wait_for_page() |
| 133 | check_table_names(dash_duo, ["a", "b"]) |
| 134 | rename_and_hide(dash_duo) |
| 135 | check_table_names(dash_duo, [NEW_NAME]) |
| 136 | dash_duo.wait_for_page() |
| 137 | check_table_names(dash_duo, ["a", "b"]) |
| 138 | |
| 139 | # falsy to previous truthy also brings the values |
| 140 | app.persistence.value = 2 |
| 141 | dash_duo.wait_for_page() |
| 142 | dash_duo.wait_for_text_to_equal("#out", "names: [a, two]; hidden: [c0]") |
| 143 | check_table_names(dash_duo, ["two"]) |
| 144 | |
| 145 | |
| 146 | def test_rdps002_session_reload(dash_duo): |
nothing calls this directly
no test coverage detected
searching dependent graphs…