-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrpt_utils_022.py
executable file
·40 lines (31 loc) · 1.2 KB
/
rpt_utils_022.py
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
34
35
36
37
38
39
40
#!/usr/bin/env python
"""
(C) Copyright IBM Corp. 2008
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. This
file and program are licensed under a BSD style license. See
the Copying file included with the OpenHPI distribution for
full licensing terms.
Authors:
Jayashree Padmanabhan <[email protected]>
"""
import unittest
from openhpi import *
from rpt_resources import rptentries
class TestSequence(unittest.TestCase):
"""
runTest : Starting with an empty RPTable, adds 1 resource to it
that has an invalid Resource Id like SAHPI_FIRST_ENTRY.
Passes the test if the interface returns an error, else it fails.
Return value: 0 on success, 1 on failure
"""
def runTest(self):
rptable = RPTable()
oh_init_rpt(rptable)
saved_rid = rptentries[0].ResourceId
rptentries[0].ResourceId = SAHPI_FIRST_ENTRY
self.assertEqual(not (oh_add_resource(rptable, rptentries[0], None, 0)), 0)
rptentries[0].ResourceId = saved_rid
if __name__=='__main__':
unittest.main()