def import_files(cls, filepath): if filepath.endswith(".csv"): return CsvImporter.import_data(filepath) elif filepath.endswith(".json"): return JsonImporter.import_data(filepath) elif filepath.endswith(".xml"): return XmlImporter.import_data(filepath)
def test_validar_extensao_invalida_do_csvimporter(): with pytest.raises(ValueError, match="Arquivo inválido"): assert CsvImporter.import_data('inventory_report/data/inventory.json')
def test_validar_classe_csvimporter_esta_importando_para_uma_lista(): report = CsvImporter.import_data('inventory_report/data/inventory.csv') assert DICT == report