|
@@ -22,6 +22,9 @@ class SinkTestCase(unittest.TestCase):
|
22
|
22
|
self.obj_valid_gb = pdbuddy.SinkConfig(status=pdbuddy.SinkStatus.VALID,
|
23
|
23
|
flags=pdbuddy.SinkFlags.GIVEBACK, v=15000, vmin=None,
|
24
|
24
|
vmax=None, i=3000)
|
|
25
|
+ self.obj_range = pdbuddy.SinkConfig(status=pdbuddy.SinkStatus.VALID,
|
|
26
|
+ flags=pdbuddy.SinkFlags.HV_PREFERRED, v=13800, vmin=12000,
|
|
27
|
+ vmax=16000, i=2000)
|
25
|
28
|
|
26
|
29
|
self.obj_huge_v = pdbuddy.SinkConfig(status=pdbuddy.SinkStatus.VALID,
|
27
|
30
|
flags=pdbuddy.SinkFlags.NONE, v=65536, vmin=None, vmax=None,
|
|
@@ -33,6 +36,10 @@ class SinkTestCase(unittest.TestCase):
|
33
|
36
|
flags=pdbuddy.SinkFlags.NONE, v=-1, vmin=None, vmax=None,
|
34
|
37
|
i=1000)
|
35
|
38
|
|
|
39
|
+ self.obj_inv_range = pdbuddy.SinkConfig(status=pdbuddy.SinkStatus.VALID,
|
|
40
|
+ flags=pdbuddy.SinkFlags.HV_PREFERRED, v=13800, vmin=16000,
|
|
41
|
+ vmax=12000, i=2000)
|
|
42
|
+
|
36
|
43
|
self.obj_huge_i = pdbuddy.SinkConfig(status=pdbuddy.SinkStatus.VALID,
|
37
|
44
|
flags=pdbuddy.SinkFlags.NONE, v=5000, vmin=None, vmax=None,
|
38
|
45
|
i=65536)
|
|
@@ -68,6 +75,10 @@ class SinkTestCase(unittest.TestCase):
|
68
|
75
|
self.pdbs.set_tmpcfg(self.obj_valid_gb)
|
69
|
76
|
self.assertEqual(self.pdbs.get_tmpcfg(), self.obj_valid_gb)
|
70
|
77
|
|
|
78
|
+ def test_set_tmpcfg_range(self):
|
|
79
|
+ self.pdbs.set_tmpcfg(self.obj_range)
|
|
80
|
+ self.assertEqual(self.pdbs.get_tmpcfg(), self.obj_range)
|
|
81
|
+
|
71
|
82
|
def test_set_tmpcfg_huge_v(self):
|
72
|
83
|
with self.assertRaises(ValueError):
|
73
|
84
|
self.pdbs.set_tmpcfg(self.obj_huge_v)
|
|
@@ -80,6 +91,10 @@ class SinkTestCase(unittest.TestCase):
|
80
|
91
|
with self.assertRaises(ValueError):
|
81
|
92
|
self.pdbs.set_tmpcfg(self.obj_neg_v)
|
82
|
93
|
|
|
94
|
+ def test_set_tmpcfg_inv_range(self):
|
|
95
|
+ with self.assertRaises(ValueError):
|
|
96
|
+ self.pdbs.set_tmpcfg(self.obj_inv_range)
|
|
97
|
+
|
83
|
98
|
def test_set_tmpcfg_huge_i(self):
|
84
|
99
|
with self.assertRaises(ValueError):
|
85
|
100
|
self.pdbs.set_tmpcfg(self.obj_huge_i)
|