Skip to content

Commit

Permalink
Fixes tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Mar 12, 2015
1 parent 4149ed3 commit 1bfdfc4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/test_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
from uuid import uuid4

from gns3.project import Project
from gns3.http_client import HTTPClient


def test_project_post_non_initialized_project_local_server(tmpdir, local_server):
"""
Test a post on a local servers. The project
is not created on the server and should be created automaticaly.
is not created on the server and should be created automatically.
And after make the call
"""

Expand All @@ -41,7 +40,8 @@ def test_project_post_non_initialized_project_local_server(tmpdir, local_server)
args, kwargs = mock.call_args
assert args[0] == "POST"
assert args[1] == "/projects"
assert kwargs["body"] == {"temporary": False,
assert kwargs["body"] == {"name": None,
"temporary": False,
"path": str(tmpdir),
"project_id": None}

Expand Down Expand Up @@ -74,7 +74,8 @@ def test_project_post_non_created_project_local_server(tmpdir, local_server):
args, kwargs = mock.call_args
assert args[0] == "POST"
assert args[1] == "/projects"
assert kwargs["body"] == {"temporary": False,
assert kwargs["body"] == {"name": None,
"temporary": False,
"project_id": uuid,
"path": str(tmpdir)}

Expand Down Expand Up @@ -106,7 +107,7 @@ def test_project_post_non_created_project_remote_server(remote_server):
args, kwargs = mock.call_args
assert args[0] == "POST"
assert args[1] == "/projects"
assert kwargs["body"] == {"temporary": False, "project_id": uuid}
assert kwargs["body"] == {"name": None, "temporary": False, "project_id": uuid}

args[2]({}, server=remote_server)

Expand Down Expand Up @@ -331,7 +332,7 @@ def test_project_moveFromTemporaryToPath(tmpdir, local_server):
assert mock.called
args, kwargs = mock.call_args
assert args[0] == "/projects/{project_id}".format(project_id=project.id())
assert kwargs["body"] == {"path": str(tmpdir), "temporary": False}
assert kwargs["body"] == {"name": None, "path": str(tmpdir), "temporary": False}

assert project.temporary() is False
assert project.filesDir() == str(tmpdir)
Expand Down

0 comments on commit 1bfdfc4

Please sign in to comment.