MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _xmltv_file

Function _xmltv_file

apps/epg/tests/test_parse_programs_for_source.py:28–43  ·  view source on GitHub ↗
(programmes)

Source from the content-addressed store, hash-verified

26
27
28def _xmltv_file(programmes):
29 body = (
30 '<?xml version="1.0" encoding="UTF-8"?>\n'
31 '<tv generator-info-name="test">\n'
32 f'{programmes}'
33 '</tv>\n'
34 )
35 handle = tempfile.NamedTemporaryFile(
36 mode='w',
37 suffix='.xml',
38 delete=False,
39 encoding='utf-8',
40 )
41 handle.write(body)
42 handle.close()
43 return handle.name
44
45
46class ParseProgramsForSourceTests(TestCase):

Callers 1

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected