diff --git a/git_trace2_event_log.py b/git_trace2_event_log.py index dfbded15..fe34092a 100644 --- a/git_trace2_event_log.py +++ b/git_trace2_event_log.py @@ -92,7 +92,7 @@ class EventLog(object): def _AddVersionEvent(self): """Adds a 'version' event at the beginning of current log.""" version_event = self._CreateEventDict('version') - version_event['evt'] = 2 + version_event['evt'] = "2" version_event['exe'] = RepoSourceVersion() self._log.insert(0, version_event) diff --git a/tests/test_git_trace2_event_log.py b/tests/test_git_trace2_event_log.py index 686802ea..8fb38dbe 100644 --- a/tests/test_git_trace2_event_log.py +++ b/tests/test_git_trace2_event_log.py @@ -95,6 +95,8 @@ class EventLogTestCase(unittest.TestCase): # Check for 'version' event specific fields. self.assertIn('evt', version_event) self.assertIn('exe', version_event) + # Verify "evt" version field is a string. + self.assertIsInstance(version_event['evt'], str) def test_start_event(self): """Test and validate 'start' event data is valid.