-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
196 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
def test_always_passes(): | ||
assert True | ||
from contextvars import copy_context | ||
from dash._callback_context import context_value | ||
from dash._utils import AttributeDict | ||
|
||
# Import the names of callback functions you want to test | ||
from app.app import upload_data | ||
|
||
|
||
TEST_DATA = "/Users/giuliacrocioni/Desktop/docs/eScience/projects/NPLinker/nplinker-webapp/nplinker_quickstart/output/npl.pkl" | ||
def test_update_callback(): | ||
output = upload_data(1, 0) | ||
assert output == "button 1: 1 & button 2: 0" | ||
|
||
|
||
def test_display_callback(): | ||
def run_callback(): | ||
context_value.set( | ||
AttributeDict(**{"triggered_inputs": [{"prop_id": "btn-1-ctx-example.n_clicks"}]}) | ||
) | ||
return display(1, 0, 0) | ||
|
||
ctx = copy_context() | ||
output = ctx.run(run_callback) | ||
assert output == "You last clicked button with ID btn-1-ctx-example" |