-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/develop'
- Loading branch information
Showing
10 changed files
with
126 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
description="A command line interface to autograder.io", | ||
long_description=LONG_DESCRIPTION, | ||
long_description_content_type="text/markdown", | ||
version="0.4.0", | ||
version="0.5.0", | ||
author="Andrew DeOrio", | ||
author_email="[email protected]", | ||
url="https://github.com/eecs485staff/agio-cli/", | ||
|
@@ -27,7 +27,7 @@ | |
], | ||
install_requires=[ | ||
"click", | ||
"pick", | ||
"pick>=2.0.0", | ||
"python-dateutil", | ||
"requests", | ||
], | ||
|
@@ -49,7 +49,7 @@ | |
"requests-mock", | ||
], | ||
}, | ||
python_requires='>=3.6', | ||
python_requires='>=3.7', | ||
entry_points={ | ||
"console_scripts": [ | ||
"agio = agiocli.__main__:main", | ||
|
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
import json | ||
import click | ||
import click.testing | ||
from pick import Option | ||
from agiocli.__main__ import main | ||
|
||
|
||
|
@@ -36,6 +37,30 @@ def test_groups_list(api_mock): | |
assert "[246965] awdeorio" in result.output | ||
|
||
|
||
def test_groups_list_json(api_mock): | ||
"""Verify agio groups queue option when project is specified. | ||
$ agio groups --list-json --project 1005 | ||
api_mock is a shared test fixture that mocks responses to REST API | ||
requests. It is implemented in conftest.py. | ||
""" | ||
runner = click.testing.CliRunner() | ||
result = runner.invoke( | ||
main, [ | ||
"groups", | ||
"--list-json", | ||
"--project", "1005", | ||
], | ||
catch_exceptions=False, | ||
) | ||
assert result.exit_code == 0, result.output | ||
result_list = json.loads(result.output) | ||
assert ["[email protected]"] in result_list | ||
assert ["[email protected]"] in result_list | ||
|
||
|
||
def test_groups_pk(api_mock): | ||
"""Verify groups subcommand with primary key input. | ||
|
@@ -102,8 +127,10 @@ def test_groups_empty(api_mock, mocker, constants): | |
# These are constants in conftest.py. Mock input "awdeorio", which selects | ||
# a group. | ||
mocker.patch("pick.pick", side_effect=[ | ||
(constants["COURSE_109"], 1), # First call to pick() selects course | ||
(constants["PROJECT_1005"], 0), # Second call selects project | ||
# First call to pick() selects course | ||
(Option(constants["COURSE_109"], constants["COURSE_109"]), 1), | ||
# Second call selects project | ||
(Option(constants["PROJECT_1005"], constants["PROJECT_1005"]), 0), | ||
]) | ||
mocker.patch("builtins.input", return_value="awdeorio") | ||
|
||
|
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