Skip to content

Commit

Permalink
adjust else block in logevent.py __init__() to fix logevent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-allan authored and stennie committed May 2, 2023
1 parent 2b6731e commit 370e598
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions mtools/test/test_util_logevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def test_logevent_actual_sort_parsing():
le = LogEvent(line_pattern_26_c)
assert(le.actual_sort) == '{ b: 1.0 }'

@pytest.mark.skip(reason='TODO: update profile parsing')
# @pytest.mark.skip(reason='TODO: update profile parsing')
def test_logevent_profile_pattern_parsing():
le = LogEvent(profile_doc1)
assert(le.pattern == '{"test": 1}')
Expand All @@ -203,7 +203,7 @@ def test_logevent_profile_pattern_parsing():
le = LogEvent(profile_doc3)
assert(le.pattern == '{"test": 1}')

@pytest.mark.skip(reason='TODO: update profile parsing')
# @pytest.mark.skip(reason='TODO: update profile parsing')
def test_logevent_profile_sort_pattern_parsing():
le = LogEvent(profile_doc1)
assert(le.sort_pattern is None)
Expand Down
14 changes: 7 additions & 7 deletions mtools/util/logevent.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ def __init__(self, doc_or_str, fulldoc = True, pretty = False):

# Legacy log lines will be parsed lazily
self._reset()
else:
# Assume this is a system.profile document
self.from_string = False
self.logformat = LogFormat.PROFILE
if fulldoc:
self._doc = doc_or_str
self._parse_profile_doc(doc_or_str)
else:
# Assume this is a system.profile document
self.from_string = False
self.logformat = LogFormat.PROFILE
if fulldoc:
self._doc = doc_or_str
self._parse_profile_doc(doc_or_str)

def _reset(self):
self._split_tokens_calculated = False
Expand Down

0 comments on commit 370e598

Please sign in to comment.