added tearDown() for cleanup application files

This commit is contained in:
cis-kuldeep 2021-07-26 19:45:26 +05:30
parent f2b3645cc2
commit 3c074b9b75
No known key found for this signature in database
GPG Key ID: 67B47D8A06FA45E4
2 changed files with 11 additions and 1 deletions

View File

@ -13,7 +13,10 @@ _files = (
def cleanup(home=None, files=_files):
"""Cleanup application files"""
if not home:
try:
import state
except ImportError:
from pybitmessage import state
home = state.appdata
for pfile in files:
try:

View File

@ -3,11 +3,18 @@ Tests for common protocol functions
"""
import unittest
try:
from .common import cleanup
except ImportError:
from common import cleanup
class TestProtocol(unittest.TestCase):
"""Main protocol test case"""
def tearDown(self):
cleanup()
def test_check_local(self):
"""Check the logic of TCPConnection.local"""
from pybitmessage import protocol, state