Skip to content

Commit

Permalink
fix missing linessplit
Browse files Browse the repository at this point in the history
  • Loading branch information
rkoschmitzky committed Feb 22, 2021
1 parent 9df66e6 commit 42fde1e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
3 changes: 2 additions & 1 deletion setup.py
Expand Up @@ -12,6 +12,7 @@
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Topic :: System :: Logging",
Expand All @@ -22,7 +23,7 @@

setup(
name="logmole",
version="0.9.0",
version="0.9.1",
author="Rico Koschmitzky",
author_email="contact@ricokoschmitzky.com",
classifiers=classifiers,
Expand Down
2 changes: 1 addition & 1 deletion src/logmole/containers.py
Expand Up @@ -32,7 +32,7 @@ def __init__(self, file):
with open(file) as f:
self._parse_data(f)
else:
self._parse_data(file)
self._parse_data(file.splitlines())

self._tree = self._generate_member_tree()

Expand Down
22 changes: 14 additions & 8 deletions tests/test_containers.py
Expand Up @@ -106,18 +106,24 @@ def test_members(self):
self.assertTrue(issubclass(x.children.child2, LogContainer))

def test_tree(self):
self.assertDictEqual(containers.ParentsContainer(self._log)._tree, self._expected_dict)
for file_or_stream in [self._log, self._logstream]:
self.assertDictEqual(
containers.ParentsContainer(file_or_stream)._tree,
self._expected_dict
)

def test_get_value(self):

x = containers.ParentsContainer(self._log)
for file_or_stream in [self._log, self._logstream]:
x = containers.ParentsContainer(file_or_stream)

self.assertIsNone(x.get_value("mother"))
self.assertEqual(x.get_value("parents", default=6), 6)
self.assertEqual(x.get_value("parents.father"), "Peter")
self.assertEqual(x.get_value("parents.mother"), "Jane")
self.assertEqual(x.get_value("children.child1.name"), "Dave")
self.assertEqual(x.get_value("children.child2.name"), "Lea")

self.assertIsNone(x.get_value("mother"))
self.assertEqual(x.get_value("parents", default=6), 6)
self.assertEqual(x.get_value("parents.father"), "Peter")
self.assertEqual(x.get_value("parents.mother"), "Jane")
self.assertEqual(x.get_value("children.child1.name"), "Dave")
self.assertEqual(x.get_value("children.child2.name"), "Lea")

def test_dump(self):

Expand Down

0 comments on commit 42fde1e

Please sign in to comment.