-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- updated verdi restapi command and its click parameters - removed load_profile functionality from restapi code as it is already handled by verdi command - removed __main__ from restapi code as it is duplicating the functionality provided by 'verdi restapi' command
- Loading branch information
Snehal Kumbhar
committed
May 9, 2019
1 parent
8836a8f
commit 16e4020
Showing
6 changed files
with
92 additions
and
141 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Tests for `verdi restapi`.""" | ||
from __future__ import division | ||
from __future__ import print_function | ||
from __future__ import absolute_import | ||
|
||
from click.testing import CliRunner | ||
|
||
from aiida.backends.testbase import AiidaTestCase | ||
from aiida.cmdline.commands.cmd_restapi import restapi | ||
|
||
|
||
class TestVerdiRestapiCommand(AiidaTestCase): | ||
"""tests for verdi restapi command""" | ||
|
||
def setUp(self): | ||
super(TestVerdiRestapiCommand, self).setUp() | ||
self.cli_runner = CliRunner() | ||
|
||
def test_run_restapi(self): | ||
"""Test `verdi restapi`.""" | ||
|
||
options = ['--no-hookup', '--hostname', 'localhost', '--port', '6000', '--debug', '--wsgi-profile'] | ||
|
||
result = self.cli_runner.invoke(restapi, options) | ||
self.assertIsNone(result.exception, result.output) | ||
self.assertClickSuccess(result) | ||
|
||
def test_help(self): | ||
"""Tests help text for restapi command.""" | ||
options = ['--help'] | ||
|
||
# verdi restapi | ||
result = self.cli_runner.invoke(restapi, options) | ||
self.assertIsNone(result.exception, result.output) | ||
self.assertIn('Usage', result.output) |
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