-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test for /workflows endpoint
* Bumps `isort` version and amends import sort accordingly.
- Loading branch information
Diego Rodriguez
committed
Jun 2, 2017
1 parent
f80b8fe
commit 3ff2a4e
Showing
13 changed files
with
155 additions
and
28 deletions.
There are no files selected for viewing
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 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 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 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 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 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 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
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# This file is part of REANA. | ||
# Copyright (C) 2017 CERN. | ||
# | ||
# REANA is free software; you can redistribute it and/or modify it under the | ||
# terms of the GNU General Public License as published by the Free Software | ||
# Foundation; either version 2 of the License, or (at your option) any later | ||
# version. | ||
# | ||
# REANA is distributed in the hope that it will be useful, but WITHOUT ANY | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License along with | ||
# REANA; if not, write to the Free Software Foundation, Inc., 59 Temple Place, | ||
# Suite 330, Boston, MA 02111-1307, USA. | ||
# | ||
# In applying this license, CERN does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an Intergovernmental Organization or | ||
# submit itself to any jurisdiction. | ||
"""REANA-Workflow-Controller fsdb module tests.""" | ||
|
||
from __future__ import absolute_import, print_function | ||
|
||
import json | ||
|
||
from flask import url_for | ||
|
||
|
||
def test_get_workflows(app): | ||
"""Test listing all workflows.""" | ||
with app.test_client() as client: | ||
res = client.get(url_for('get_workflows')) | ||
assert res.status_code == 200 | ||
response_data = json.loads(res.get_data(as_text=True)) | ||
expected_data = { | ||
"workflows": [{ | ||
"id": "6f6cd692-0eb2-439d-82bf-2f26ae992672", | ||
"organization": "alice", | ||
"status": "running", | ||
"tenant": "default_tenant" | ||
}, { | ||
"id": "3c9b117c-d40a-49e3-a6de-5f89fcada5a3", | ||
"organization": "atlas", | ||
"status": "waiting", | ||
"tenant": "default_tenant" | ||
}, { | ||
"id": "72e3ee4f-9cd3-4dc7-906c-24511d9f5ee3", | ||
"organization": "cms", | ||
"status": "finished", | ||
"tenant": "default_tenant" | ||
}, { | ||
"id": "c4c0a1a6-beef-46c7-be04-bf4b3beca5a1", | ||
"organization": "lhcb", | ||
"status": "finished", | ||
"tenant": "default_tenant" | ||
}] | ||
} | ||
|
||
assert response_data == expected_data |