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