Skip to content

Commit

Permalink
Make sure the testsuite does not leave artifacts behind
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurmen authored and Evidlo committed Feb 10, 2024
1 parent a2da685 commit e2f7517
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
import shutil
import tempfile
import unittest
import uuid
from datetime import datetime, timedelta, timezone
Expand Down Expand Up @@ -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, '<?xml version=\'1.0\' encoding=\'utf-8\' standalone=\'yes\'?>\n')

Expand Down

0 comments on commit e2f7517

Please sign in to comment.