From f23bf953c52e9bb0cd74f7df097dab05c1da5fc3 Mon Sep 17 00:00:00 2001 From: Douglas Thor Date: Tue, 14 May 2019 13:26:10 -0700 Subject: [PATCH] Update tests for the `/plot/` route: + separate out test_plot_with_data to '_by_name' and '_by_id' + Remove skipped test - replaced by new ones. (which are also skipped... but now I have a better reason for it!) --- tests/test_routes.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/test_routes.py b/tests/test_routes.py index 04a06f1..2083e47 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -56,22 +56,28 @@ def test_index_with_data(client, populated_db): assert b"foo.bar" in rv.data -@pytest.mark.xfail(reason="Needs code updates") -def test_plot(client): - rv = client.get("/plot/foo") - assert rv.status_code == 404 - - -def test_plot_with_data(client, populated_db): +@pytest.mark.xfail( + reason="JS callbacks are async: plotly div not populated immediatly" +) +def test_plot_with_data_by_name(client, populated_db): rv = client.get("/plot/foo") assert rv.status_code == 200 assert b"foo" in rv.data assert b'
' in rv.data + +@pytest.mark.xfail( + reason="JS callbacks are async: plotly div not populated immediatly" +) +def test_plot_with_data_by_id(client, populated_db): rv = client.get("/plot/1") assert rv.status_code == 200 assert b"foo" in rv.data assert b'
' in rv.data def test_api_add(client):