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 committed Oct 23, 2022
1 parent 7fa6e97 commit 1a22f84
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 @@ -6,6 +6,7 @@
import logging
import os
import shutil
import tempfile
import unittest
import uuid
from datetime import datetime, timedelta
Expand Down Expand Up @@ -831,8 +832,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 1a22f84

Please sign in to comment.