"""Pytest conftest module.""" import os from ddex_ingester_common.constants.xmltodict import DDEX_LIST_FIELDS import pytest import xmltodict DATA_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'data',) @pytest.fixture def awal_ddex_document_album(): """AWAL DDEX document deserialized into a dict.""" with open(os.path.join(DATA_DIR, 'DDEX382Album_5054526846562.xml')) as fd: # noqa return xmltodict.parse(fd.read(), force_list=DDEX_LIST_FIELDS) @pytest.fixture def awal_ddex_document_single(): """AWAL DDEX document deserialized into a dict.""" with open(os.path.join(DATA_DIR, 'DDEX382Single_5054526008465.xml')) as fd: # noqa return xmltodict.parse(fd.read(), force_list=DDEX_LIST_FIELDS) @pytest.fixture def awal_video_ddex(): """AWAL Video DDEX deserialized into a dict.""" with open(os.path.join(DATA_DIR, 'awal-video-single.xml')) as fd: # noqa return xmltodict.parse(fd.read(), force_list=DDEX_LIST_FIELDS)