Commit f22ec7f1 by Belákovics Ádám

Merge remote-tracking branch 'remotes/origin/tests' into DEV

parents c0739359 dbcdad9d
Pipeline #735 passed with stage
in 39 seconds
...@@ -2,4 +2,4 @@ unittest: ...@@ -2,4 +2,4 @@ unittest:
image: python:3.7.3 image: python:3.7.3
script: script:
- pip install -r requirements.txt - pip install -r requirements.txt
- python -m unittest discover -s test - python -m unittest discover
import unittest
from interface.image.Image import Image
class TestImage(unittest.TestCase):
def test_fields(self):
image = Image('id', 'name', 'format')
self.assertEqual(image.id, 'id')
self.assertEqual(image.name, 'name')
self.assertEqual(image.format, 'format')
if __name__ == '__main__':
unittest.main()
import unittest
from interface.storage.Snapshot import Snapshot
class TestSnapshot(unittest.TestCase):
def test_fields(self):
snapshot = Snapshot('id', 'volume_id', 1, 'status', 'created_at')
self.assertEqual(snapshot.id, 'id')
self.assertEqual(snapshot.volume_id, 'volume_id')
self.assertEqual(snapshot.size, 1)
self.assertEqual(snapshot.status, 'status')
self.assertEqual(snapshot.created_at, 'created_at')
if __name__ == '__main__':
unittest.main()
import unittest
from interface.storage.Volume import Volume
class TestVolume(unittest.TestCase):
def test_fields(self):
volume = Volume('id', 'image_id', 1, False, 'status', 'created_at')
self.assertEqual(volume.id, 'id')
self.assertEqual(volume.image_id, 'image_id')
self.assertEqual(volume.size, 1)
self.assertEqual(volume.bootable, False)
self.assertEqual(volume.status, 'status')
self.assertEqual(volume.created_at, 'created_at')
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment