Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the testsuite does not leave artifacts behind #324

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import uuid
from datetime import datetime, timedelta, timezone

# FIXME: remove dateutil dependency as per https://github.com/libkeepass/pykeepass/pull/371
from dateutil import tz
from pathlib import Path

from io import BytesIO
Expand Down Expand Up @@ -890,10 +892,12 @@ 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:
dump_file = base_dir / 'db_dump.xml'
self.kp.dump_xml(dump_file)
with open(dump_file) as f:
first_line = f.readline()
self.assertEqual(first_line, '<?xml version=\'1.0\' encoding=\'utf-8\' standalone=\'yes\'?>\n')
dump_file.unlink()

def test_credchange(self):
"""
Expand Down
Loading