Merge pull request #149 from viktorTarasov/fix/session/session_name

fix: session: 'expected str instance, NoneType found'
This commit is contained in:
Peter Hamilton 2016-03-28 16:47:24 -04:00
commit 8cc7c5f8e0
2 changed files with 9 additions and 0 deletions

View File

@ -51,6 +51,9 @@ class KmipSession(threading.Thread):
kwargs={} kwargs={}
) )
if name is None:
name = self.name
self._logger = logging.getLogger('.'.join((__name__, name))) self._logger = logging.getLogger('.'.join((__name__, name)))
self._engine = engine self._engine = engine

View File

@ -38,6 +38,12 @@ class TestKmipSession(testtools.TestCase):
""" """
session.KmipSession(None, None, 'name') session.KmipSession(None, None, 'name')
def test_init_without_name(self):
"""
Test that a KmipSession without 'name' can be created without errors.
"""
session.KmipSession(None, None, None)
def test_run(self): def test_run(self):
""" """
Test that the message handling loop is handled properly on normal Test that the message handling loop is handled properly on normal