added tearDown() for cleanup application files
This commit is contained in:
parent
f2b3645cc2
commit
3c074b9b75
|
@ -13,7 +13,10 @@ _files = (
|
||||||
def cleanup(home=None, files=_files):
|
def cleanup(home=None, files=_files):
|
||||||
"""Cleanup application files"""
|
"""Cleanup application files"""
|
||||||
if not home:
|
if not home:
|
||||||
import state
|
try:
|
||||||
|
import state
|
||||||
|
except ImportError:
|
||||||
|
from pybitmessage import state
|
||||||
home = state.appdata
|
home = state.appdata
|
||||||
for pfile in files:
|
for pfile in files:
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -3,11 +3,18 @@ Tests for common protocol functions
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
try:
|
||||||
|
from .common import cleanup
|
||||||
|
except ImportError:
|
||||||
|
from common import cleanup
|
||||||
|
|
||||||
|
|
||||||
class TestProtocol(unittest.TestCase):
|
class TestProtocol(unittest.TestCase):
|
||||||
"""Main protocol test case"""
|
"""Main protocol test case"""
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
cleanup()
|
||||||
|
|
||||||
def test_check_local(self):
|
def test_check_local(self):
|
||||||
"""Check the logic of TCPConnection.local"""
|
"""Check the logic of TCPConnection.local"""
|
||||||
from pybitmessage import protocol, state
|
from pybitmessage import protocol, state
|
||||||
|
|
Reference in New Issue
Block a user