Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
okeanos-LoD
Commits
af6e6598
Commit
af6e6598
authored
Mar 21, 2016
by
Ioannis Tsafaras
Browse files
Fix application upload test
parent
8644642e
Changes
1
Hide whitespace changes
Inline
Side-by-side
webapp/tests/test_applications.py
View file @
af6e6598
...
...
@@ -38,11 +38,13 @@ class TestApplicationUpload(APITestCase):
application_type_streaming
=
"streaming"
# project_name
project_name
=
"lambda.grnet.gr"
# project_id
project_id
=
uuid
.
uuid4
()
# execution_environment_name
execution_environment_name
=
"Stream"
user_projects
=
[
{
'name'
:
"lambda.grnet.gr"
,
'id'
:
uuid
.
uuid4
()
},
{
'name'
:
"lambda.grnet.gr"
,
'id'
:
project_id
},
{
'name'
:
"project_1"
,
'id'
:
uuid
.
uuid4
()},
{
'name'
:
"project_2"
,
'id'
:
uuid
.
uuid4
()},
{
'name'
:
"project_3"
,
'id'
:
uuid
.
uuid4
()},
...
...
@@ -109,10 +111,14 @@ class TestApplicationUpload(APITestCase):
# Test for uploading an application when all the required information are provided
# but there is already an application with the same name uploaded.
def
test_existent_name
(
self
):
@
mock
.
patch
(
'backend.views.get_user_okeanos_projects'
)
def
test_existent_name
(
self
,
mock_get_user_okeanos_projects
):
# Configure return values for mocks
mock_get_user_okeanos_projects
.
return_value
=
self
.
user_projects
# Create an application on the database.
Application
.
objects
.
create
(
uuid
=
uuid
.
uuid4
(),
name
=
"existing_application.jar"
,
type
=
Application
.
BATCH
)
type
=
Application
.
BATCH
,
project_id
=
self
.
project_id
)
# file
existing_application
=
SimpleUploadedFile
(
"existing_application.jar"
,
"Hello World"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment