Revision 0d20cc42 test/testutils.py
b/test/testutils.py | ||
---|---|---|
136 | 136 |
actual_mode = stat.S_IMODE(st.st_mode) |
137 | 137 |
self.assertEqual(actual_mode, expected_mode) |
138 | 138 |
|
139 |
def assertFileUid(self, file_name, expected_uid): |
|
140 |
"""Checks that the user id of a file is what we expect. |
|
141 |
|
|
142 |
@type file_name: str |
|
143 |
@param file_name: the file whose contents we should check |
|
144 |
@type expected_uid: int |
|
145 |
@param expected_uid: the user id we expect |
|
146 |
|
|
147 |
""" |
|
148 |
st = os.stat(file_name) |
|
149 |
actual_uid = st.st_uid |
|
150 |
self.assertEqual(actual_uid, expected_uid) |
|
151 |
|
|
152 |
def assertFileGid(self, file_name, expected_gid): |
|
153 |
"""Checks that the group id of a file is what we expect. |
|
154 |
|
|
155 |
@type file_name: str |
|
156 |
@param file_name: the file whose contents we should check |
|
157 |
@type expected_gid: int |
|
158 |
@param expected_gid: the group id we expect |
|
159 |
|
|
160 |
""" |
|
161 |
st = os.stat(file_name) |
|
162 |
actual_gid = st.st_gid |
|
163 |
self.assertEqual(actual_gid, expected_gid) |
|
164 |
|
|
139 | 165 |
def assertEqualValues(self, first, second, msg=None): |
140 | 166 |
"""Compares two values whether they're equal. |
141 | 167 |
|
Also available in: Unified diff