-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_job.py
More file actions
33 lines (27 loc) · 1016 Bytes
/
test_job.py
File metadata and controls
33 lines (27 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
Unit tests for the Drycc scheduler module.
Run the tests with './manage.py test scheduler'
"""
from scheduler.tests import TestCase
from scheduler.utils import generate_random_name
class JobTest(TestCase):
"""Tests scheduler pod calls"""
def create(self, namespace=None, name=generate_random_name(), **kwargs):
"""
Helper function to create and verify a pod on the namespace
"""
namespace = self.namespace if namespace is None else namespace
# these are all required even if it is kwargs...
kwargs = {
'app_type': kwargs.get('app_type', 'web'),
'version': kwargs.get('version', 'v99'),
'image': 'quay.io/fake/image',
'command': 'sh',
'args': 'start',
'deploy_timeout': 10,
}
job = self.scheduler.job.create(namespace, name, **kwargs)
self.assertEqual(job.status_code, 201, job.json())
return name
def test_create(self):
self.create()