Beispiel #1
0
    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)
Beispiel #2
0
def test_validar_extensao_invalida_jsonimporter():
    with pytest.raises(ValueError, match="Arquivo inválido"):
        assert JsonImporter.import_data('inventory_report/data/inventory.csv')
Beispiel #3
0
def test_validar_classe_jsonimporter_esta_importando_para_uma_lista():
    report = JsonImporter.import_data('inventory_report/data/inventory.json')
    assert DICT == report