2025-02-05 13:43:43 +01:00
|
|
|
#!/usr/bin/python
|
|
|
|
# coding: utf-8 -*-
|
2025-02-10 06:39:52 +01:00
|
|
|
"""Fixtures for tests"""
|
2025-02-05 13:50:07 +01:00
|
|
|
|
2025-02-05 13:43:43 +01:00
|
|
|
import pytest
|
2025-02-10 06:39:52 +01:00
|
|
|
import os
|
|
|
|
import xml.etree.ElementTree as ET
|
2025-02-05 13:43:43 +01:00
|
|
|
|
2025-02-10 06:39:52 +01:00
|
|
|
# Fixtures
|
2025-02-05 13:43:43 +01:00
|
|
|
@pytest.fixture
|
2025-02-10 06:39:52 +01:00
|
|
|
def xml_path() -> str:
|
|
|
|
"""Fixture to provide path to test XML file"""
|
|
|
|
return os.path.join(os.path.dirname(os.path.dirname(__file__)), "data.xml")
|
2025-02-05 13:43:43 +01:00
|
|
|
|
|
|
|
|
2025-02-10 06:39:52 +01:00
|
|
|
@pytest.fixture
|
|
|
|
def xml_data():
|
|
|
|
xml_file = os.path.join(os.path.dirname(__file__), "data.xml")
|
|
|
|
tree = ET.parse(xml_file)
|
|
|
|
root = tree.getroot()
|
|
|
|
return root
|