diff --git a/tests/tests.py b/tests/tests.py index 9f7e4daa..b44d266f 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -3,6 +3,7 @@ import logging import os import shutil +import tempfile import unittest import uuid from datetime import datetime, timedelta, timezone @@ -890,8 +891,10 @@ def test_set_credentials(self): self.assertEqual('foobar_user', results.username) def test_dump_xml(self): - self.kp.dump_xml('db_dump.xml') - with open('db_dump.xml') as f: + self.test_dir = tempfile.mkdtemp() + self.dump_file = os.path.join(self.test_dir, 'db_dump.xml') + self.kp.dump_xml(self.dump_file) + with open(self.dump_file) as f: first_line = f.readline() self.assertEqual(first_line, '\n')