Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
720ab1e4
authored
Apr 16, 2020
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Image test cases deprecated
parent
4b359aa6
Pipeline
#1069
passed with stage
in 1 minute 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
recircle/image/tests/test_models_unit.py
+12
-4
No files found.
recircle/image/tests/test_models_unit.py
View file @
720ab1e4
from
django.test
import
TestCase
"""
from django.contrib.auth.models import User
from unittest.mock import Mock
from unittest.mock import patch
...
...
@@ -11,10 +12,16 @@ from instance.models import Lease
from interface_openstack.interface.image.image import Image as RemoteImage
from interface_openstack.interface.vm.resources import Flavor as RemoteFlavor
from template.models import ImageTemplate
"""
class
ImageModelsTest
(
TestCase
):
@staticmethod
# Need review and rewrite because multiple changes in other modules
# (Btw unit tests should not depend on other modules)
pass
""" @staticmethod
def create_user(name="test_user", email="test_email", password="test_password"):
return User.objects.create_user(username=name, email=email, password=password)
...
...
@@ -29,11 +36,11 @@ class ImageModelsTest(TestCase):
def create_instance(self):
params = {"name": "test_instance",
"description": "test instance description",
"access_method"
:
"ssh"
,
"system"
:
"test_system"
,
"access_protocol": "SSH",
"system": "LINUX",
"distro": "test_distro"
"time_of_suspend": "2019-05-28 23:59",
"time_of_delete": "2019-05-28 23:59",
}
flavor = self.create_flavor()
lease = Lease.objects.create(name="test_lease", description="test lease description",
...
...
@@ -91,3 +98,4 @@ class ImageModelsTest(TestCase):
self.assertEqual(image.created_by_id, user.id)
self.assertEqual(image.uploaded_by_user, True)
self.assertEqual(image.description, description)
"""
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