File: test_delayed.py

package info (click to toggle)
python-hpilo 4.4.3-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,784 kB
  • sloc: python: 3,418; ruby: 467; makefile: 122; sh: 31
file content (23 lines) | stat: -rwxr-xr-x 618 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python

from utils import *

class DelayedTests(IloTestCase):
    def test_delayed_calls(self, ilo):
        uid = {'ON': 'Yes', 'OFF': 'No'}[ilo.get_uid_status()]
        non_delayed = [
            ilo.get_all_users(),
            ilo.get_global_settings(),
        ]
        try:
            ilo.delayed = True
            ilo.get_all_users()
            ilo.uid_control(uid=uid)
            ilo.get_global_settings()
            delayed = ilo.call_delayed()
        finally:
            ilo.delayed = False
        self.assertEquals(non_delayed, delayed)

if __name__ == '__main__':
    unittest.main()