Revision 5a904197 test/py/ganeti.backend_unittest.py
b/test/py/ganeti.backend_unittest.py | ||
---|---|---|
839 | 839 |
class TestSpaceReportingConstants(unittest.TestCase): |
840 | 840 |
"""Ensures consistency between STS_REPORT and backend. |
841 | 841 |
|
842 |
These tests ensure, that the constant 'STS_REPORT' is consitent |
|
842 |
These tests ensure, that the constant 'STS_REPORT' is consistent
|
|
843 | 843 |
with the implementation of invoking space reporting functions |
844 | 844 |
in backend.py. Once space reporting is available for all types, |
845 | 845 |
the constant can be removed and these tests as well. |
846 | 846 |
|
847 | 847 |
""" |
848 |
|
|
849 |
REPORTING = set(constants.STS_REPORT) |
|
850 |
NOT_REPORTING = set(constants.STORAGE_TYPES) - REPORTING |
|
851 |
|
|
848 | 852 |
def testAllReportingTypesHaveAReportingFunction(self): |
849 |
for storage_type in constants.STS_REPORT:
|
|
853 |
for storage_type in TestSpaceReportingConstants.REPORTING:
|
|
850 | 854 |
self.assertTrue(backend._STORAGE_TYPE_INFO_FN[storage_type] is not None) |
851 | 855 |
|
852 |
def testAllNotReportingTypesDoneHaveFunction(self): |
|
853 |
non_reporting_types = set(constants.STORAGE_TYPES)\ |
|
854 |
- set(constants.STS_REPORT) |
|
855 |
for storage_type in non_reporting_types: |
|
856 |
def testAllNotReportingTypesDontHaveFunction(self): |
|
857 |
for storage_type in TestSpaceReportingConstants.NOT_REPORTING: |
|
856 | 858 |
self.assertEqual(None, backend._STORAGE_TYPE_INFO_FN[storage_type]) |
857 | 859 |
|
858 | 860 |
|
Also available in: Unified diff