Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
update test_callbacks_triggered_on_generated_output for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Jan 20, 2019
1 parent 7a3fb11 commit 57ef3b2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,30 +1626,30 @@ def display_content(value):
[Input('outer-controls', 'value')])
def display_tab1_output(value):
call_counts['tab1'].value += 1
return 'You have selected "{}"'.format(value)
return 'Selected "{}" in tab 1'.format(value)

@app.callback(Output('tab-2-output', 'children'),
[Input('outer-controls', 'value')])
def display_tab2_output(value):
call_counts['tab2'].value += 1
return 'You have selected "{}"'.format(value)
return 'Selected "{}" in tab 2'.format(value)

self.startServer(app)
self.wait_for_element_by_css_selector('#tab-output')
time.sleep(2)

self.assertEqual(call_counts['tab1'].value, 1)
self.assertEqual(call_counts['tab2'].value, 0)
self.wait_for_text_to_equal('#tab-output', 'You have selected "a"')
self.wait_for_text_to_equal('#tab-1-output', 'You have selected "a"')
self.wait_for_text_to_equal('#tab-output', 'Selected "a" in tab 1')
self.wait_for_text_to_equal('#tab-1-output', 'Selected "a" in tab 1')

(self.driver.find_elements_by_css_selector(
'input[type="radio"]'
)[1]).click()
time.sleep(2)

self.wait_for_text_to_equal('#tab-output', 'You have selected "a"')
self.wait_for_text_to_equal('#tab-2-output', 'You have selected "a"')
self.wait_for_text_to_equal('#tab-output', 'Selected "a" in tab 2')
self.wait_for_text_to_equal('#tab-2-output', 'Selected "a" in tab 2')
self.assertEqual(call_counts['tab1'].value, 1)
self.assertEqual(call_counts['tab2'].value, 1)

Expand Down

0 comments on commit 57ef3b2

Please sign in to comment.