-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_scheduler_states.py
More file actions
30 lines (24 loc) · 1.11 KB
/
test_scheduler_states.py
File metadata and controls
30 lines (24 loc) · 1.11 KB
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
import unittest
from scheduler.states import PodState
class TestSchedulerStates(unittest.TestCase):
"""Test Scheduler States OrderedEnum"""
def test_gt_comparison(self):
self.assertTrue(PodState.up > PodState.starting)
self.assertFalse(PodState.starting > PodState.up)
with self.assertRaises(TypeError):
self.assertTrue(PodState.up > 'starting')
def test_ge_comparison(self):
self.assertTrue(PodState.up >= PodState.starting)
self.assertFalse(PodState.starting >= PodState.up)
with self.assertRaises(TypeError):
self.assertTrue(PodState.up >= 'starting')
def test_lt_comparison(self):
self.assertFalse(PodState.up < PodState.starting)
self.assertTrue(PodState.starting < PodState.up)
with self.assertRaises(TypeError):
self.assertTrue(PodState.up < 'crashed')
def test_le_comparison(self):
self.assertFalse(PodState.up <= PodState.starting)
self.assertTrue(PodState.starting <= PodState.up)
with self.assertRaises(TypeError):
self.assertTrue(PodState.up <= 'crashed')