diff options
| author | John L. Villalovos <john@sodarock.com> | 2021-05-26 21:04:31 -0700 |
|---|---|---|
| committer | John L. Villalovos <john@sodarock.com> | 2021-05-26 21:04:31 -0700 |
| commit | 1ac0722bc086b18c070132a0eb53747bbdf2ce0a (patch) | |
| tree | db9dbb8da13907eb6ee293adcaf6c9bdb1dd7d52 /gitlab/tests/objects/test_todos.py | |
| parent | 90ecf2f91129ffa0cfb5db58300fbd11638d4ecc (diff) | |
| download | gitlab-1ac0722bc086b18c070132a0eb53747bbdf2ce0a.tar.gz | |
chore: move 'gitlab/tests/' dir to 'tests/unit/'
Move the 'gitlab/tests/' directory to 'tests/unit/' so we have all the
tests located under the 'tests/' directory.
Diffstat (limited to 'gitlab/tests/objects/test_todos.py')
| -rw-r--r-- | gitlab/tests/objects/test_todos.py | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/gitlab/tests/objects/test_todos.py b/gitlab/tests/objects/test_todos.py deleted file mode 100644 index 058fe33..0000000 --- a/gitlab/tests/objects/test_todos.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -GitLab API: https://docs.gitlab.com/ce/api/todos.html -""" - -import json -import os - -import pytest -import responses - -from gitlab.v4.objects import Todo - -with open(os.path.dirname(__file__) + "/../data/todo.json", "r") as json_file: - todo_content = json_file.read() - json_content = json.loads(todo_content) - - -@pytest.fixture -def resp_todo(): - with responses.RequestsMock(assert_all_requests_are_fired=False) as rsps: - rsps.add( - method=responses.GET, - url="http://localhost/api/v4/todos", - json=json_content, - content_type="application/json", - status=200, - ) - rsps.add( - method=responses.POST, - url="http://localhost/api/v4/todos/102/mark_as_done", - json=json_content[0], - content_type="application/json", - status=200, - ) - yield rsps - - -@pytest.fixture -def resp_mark_all_as_done(): - with responses.RequestsMock() as rsps: - rsps.add( - method=responses.POST, - url="http://localhost/api/v4/todos/mark_as_done", - json={}, - content_type="application/json", - status=204, - ) - yield rsps - - -def test_todo(gl, resp_todo): - todo = gl.todos.list()[0] - assert isinstance(todo, Todo) - assert todo.id == 102 - assert todo.target_type == "MergeRequest" - assert todo.target["assignee"]["username"] == "root" - - todo.mark_as_done() - - -def test_todo_mark_all_as_done(gl, resp_mark_all_as_done): - gl.todos.mark_all_as_done() |
