Revision 6c4d8722 test/limits.py
b/test/limits.py | ||
---|---|---|
28 | 28 |
|
29 | 29 |
self.assertTrue(len(limits) == 1) |
30 | 30 |
|
31 |
def test_02_set_get(self): |
|
31 |
def test_02_set_get_empty_policy_name(self):
|
|
32 | 32 |
""" |
33 | 33 |
Tests empty policy name |
34 | 34 |
""" |
... | ... | |
56 | 56 |
|
57 | 57 |
self.assertTrue(len(limits) == 1) |
58 | 58 |
|
59 |
def test_02_set_get_bad_quantity(self): |
|
60 |
""" |
|
61 |
Test quantity that exceeds capacity. |
|
62 |
QUESTION: Should this fail? |
|
63 |
""" |
|
64 |
policy = '' |
|
65 |
capacity = 100 |
|
66 |
quantity = capacity * 2 |
|
67 |
importLimit = 10 |
|
68 |
exportLimit = 10 |
|
69 |
|
|
70 |
# SET |
|
71 |
rejected = self.qh.set_limits( |
|
72 |
context = {}, |
|
73 |
set_limits = [ |
|
74 |
(policy, quantity, capacity, importLimit, exportLimit) |
|
75 |
] |
|
76 |
) |
|
77 |
|
|
78 |
self.assertEqual([], rejected) |
|
79 |
|
|
80 |
# GET |
|
81 |
limits = self.qh.get_limits( |
|
82 |
context = {}, |
|
83 |
get_limits = [policy] # or is it just policy, i.e. no |
|
84 |
) |
|
85 |
|
|
86 |
self.assertTrue(len(limits) == 1) |
|
87 |
|
|
88 |
|
|
59 | 89 |
if __name__ == "__main__": |
60 | 90 |
import sys |
61 | 91 |
printf("Using {0}", sys.executable) |
Also available in: Unified diff