def test_parse_xsd_file_valid_row_types_in_a_specific_row(self): """Tests the expected cells in a specific row.""" rows_validators = self.dsrf_schema_parser.parse_xsd_file(self.logger) expected_su02_validators = [ cell_validators.FixedStringValidator({}, 'RecordType', self.logger, True, False), cell_validators.StringValidator('BlockId', self.logger, True, False), cell_validators.StringValidator('SalesTransactionId', self.logger, True, False), cell_validators.StringValidator('TransactedReleaseOrResource', self.logger, True, False), cell_validators.StringValidator('CommercialModelType', self.logger, True, False), cell_validators.FixedStringValidator({}, 'UseType', self.logger, True, False), cell_validators.StringValidator('Territory', self.logger, True, False), cell_validators.StringValidator('ServiceDescription', self.logger, False, False), cell_validators.BooleanValidator('IsRoyaltyBearing', self.logger, True, False), cell_validators.IntegerValidator('NumberOfStreams', self.logger, True, False), cell_validators.StringValidator('Currency', self.logger, False, False), cell_validators.DecimalValidator('PriceConsumerPaidExcSalesTax', self.logger, False, False), cell_validators.StringValidator('PromotionalActivity', self.logger, False, False), cell_validators.BooleanValidator('PreviewAvailable', self.logger, False, False), ] for actual_cell, expected_cell in zip(rows_validators['SU02'], expected_su02_validators): self.assertIsInstance(actual_cell, expected_cell.__class__) self.assertEquals(actual_cell.cell_name, expected_cell.cell_name, self.logger) self.assertEquals(actual_cell.required, expected_cell.required) self.assertEquals(actual_cell.repeated, expected_cell.repeated)
def get_validator(self): return cell_validators.BooleanValidator('boolean_cell', self.logger)