class TestDasdParser(CiTestCase): def setUp(self): super(TestDasdParser, self).setUp() self.probe_data = _get_data('probert_storage_dasd.json') self.dasd = DasdParser(self.probe_data) def test_dasd_parser(self): """ DasdParser 'class_data' on instance matches input. """ self.assertDictEqual(self.probe_data['dasd'], self.dasd.class_data) def test_dasd_asdict(self): """ DasdParser converts known dasd_data to expected dict. """ devname = "/dev/dasda" expected_dict = { 'type': 'dasd', 'id': 'dasd-dasda', 'device_id': '0.0.1522', 'blocksize': 4096, 'mode': 'quick', 'disk_layout': 'cdl', } dasd_data = self.dasd.class_data[devname] self.assertDictEqual(expected_dict, self.dasd.asdict(dasd_data)) @skipUnlessJsonSchema() def test_dasd_parser_parses_all_dasd_devs(self): """ DasdParser returns expected dicts for known dasd probe data.""" configs, errors = self.dasd.parse() self.assertEqual(5, len(configs)) self.assertEqual(0, len(errors))
def setUp(self): super(TestDasdParser, self).setUp() self.probe_data = _get_data('probert_storage_dasd.json') self.dasd = DasdParser(self.probe_data)