Skip to content

Commit

Permalink
Add resource_type and display_name to serialized nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah256 authored and mprahl committed Sep 30, 2019
1 parent d428d3b commit a6e2235
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 30 deletions.
3 changes: 2 additions & 1 deletion estuary/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def serialized(self):
rv[actual_key] = value.strftime('%Y-%m-%dT%H:%M:%SZ')
else:
rv[actual_key] = value

rv['resource_type'] = self.__label__
rv['display_name'] = self.display_name
return rv

@property
Expand Down
44 changes: 37 additions & 7 deletions tests/api/test_all_stories.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2018-05-02T10:36:47Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
'log_message': 'Related: #12345 - fix xyz',
'resource_type': 'DistGitCommit',
'display_name': 'commit #8a63adb',
}
],
'resource_type': 'BugzillaBug',
Expand Down Expand Up @@ -140,7 +142,9 @@
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2018-05-02T10:36:47Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
'log_message': 'Related: #12345 - fix xyz',
'resource_type': 'DistGitCommit',
'display_name': 'commit #8a63adb',
}
],
'resource_type': 'BugzillaBug',
Expand Down Expand Up @@ -282,11 +286,13 @@
'docker'
],
'created_at': '2018-04-21T19:36:47Z',
'display_name': 'RHBA-2017:27760-01',
'id':'123456',
'issue_date': '2018-03-14T05:53:25Z',
'product_name':'Release End2End Test',
'product_short_name':'release-e2e-test',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'DROPPED_NO_SHIP',
Expand All @@ -301,11 +307,13 @@
'docker'
],
'created_at': '2018-06-13T10:36:47Z',
'display_name': 'RHBA-2017:2251-02',
'id':'27825',
'issue_date': '2017-08-01T05:59:34Z',
'product_name':'Red Hat Enterprise Linux',
'product_short_name':'RHEL',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'SHIPPED_LIVE',
Expand All @@ -318,7 +326,9 @@
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2018-05-02T10:36:47Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
'log_message': 'Related: #12345 - fix xyz',
'resource_type': 'DistGitCommit',
'display_name': 'commit #8a63adb',
},
'completion_time': '2018-06-02T10:55:47Z',
'creation_time': '2018-06-02T10:36:47Z',
Expand Down Expand Up @@ -414,11 +424,13 @@
'docker'
],
'created_at': '2018-04-21T19:36:47Z',
'display_name': 'RHBA-2017:27760-01',
'id':'123456',
'issue_date': '2018-03-14T05:53:25Z',
'product_name':'Release End2End Test',
'product_short_name':'release-e2e-test',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'DROPPED_NO_SHIP',
Expand All @@ -433,11 +445,13 @@
'docker'
],
'created_at': '2018-06-13T10:36:47Z',
'id':'27825',
'display_name': 'RHBA-2017:2251-02',
'id': '27825',
'issue_date': '2017-08-01T05:59:34Z',
'product_name':'Red Hat Enterprise Linux',
'product_short_name':'RHEL',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'SHIPPED_LIVE',
Expand All @@ -450,7 +464,9 @@
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2018-05-02T10:36:47Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
'log_message': 'Related: #12345 - fix xyz',
'display_name': 'commit #8a63adb',
'resource_type': 'DistGitCommit',
},
'completion_time': '2018-06-02T10:55:47Z',
'creation_time': '2018-06-02T10:36:47Z',
Expand Down Expand Up @@ -546,11 +562,13 @@
'docker'
],
'created_at': '2018-04-21T19:36:47Z',
'display_name': 'RHBA-2017:27760-01',
'id':'123456',
'issue_date': '2018-03-14T05:53:25Z',
'product_name':'Release End2End Test',
'product_short_name':'release-e2e-test',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'DROPPED_NO_SHIP',
Expand All @@ -565,11 +583,13 @@
'docker'
],
'created_at': '2018-06-13T10:36:47Z',
'display_name': 'RHBA-2017:2251-02',
'id':'27825',
'issue_date': '2017-08-01T05:59:34Z',
'product_name':'Red Hat Enterprise Linux',
'product_short_name':'RHEL',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'SHIPPED_LIVE',
Expand All @@ -582,7 +602,9 @@
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2018-05-02T10:36:47Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
'log_message': 'Related: #12345 - fix xyz',
'display_name': 'commit #8a63adb',
'resource_type': 'DistGitCommit',
},
'completion_time': '2018-06-02T10:55:47Z',
'creation_time': '2018-06-02T10:36:47Z',
Expand Down Expand Up @@ -707,11 +729,13 @@
'docker'
],
'created_at': '2018-04-21T19:36:47Z',
'display_name': 'RHBA-2017:27760-01',
'id':'123456',
'issue_date': '2018-03-14T05:53:25Z',
'product_name':'Release End2End Test',
'product_short_name':'release-e2e-test',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'DROPPED_NO_SHIP',
Expand All @@ -726,11 +750,13 @@
'docker'
],
'created_at': '2018-06-13T10:36:47Z',
'display_name': 'RHBA-2017:2251-02',
'id':'27825',
'issue_date': '2017-08-01T05:59:34Z',
'product_name':'Red Hat Enterprise Linux',
'product_short_name':'RHEL',
'release_date':None,
'resource_type': 'Advisory',
'security_impact':'None',
'security_sla':None,
'state':'SHIPPED_LIVE',
Expand All @@ -743,7 +769,9 @@
'author_date': '2017-04-26T11:44:38Z',
'commit_date': '2018-05-02T10:36:47Z',
'hash': '8a63adb248ba633e200067e1ad6dc61931727bad',
'log_message': 'Related: #12345 - fix xyz'
'log_message': 'Related: #12345 - fix xyz',
'display_name': 'commit #8a63adb',
'resource_type': 'DistGitCommit'
},
'completion_time': '2018-06-02T10:55:47Z',
'creation_time': '2018-06-02T10:36:47Z',
Expand Down Expand Up @@ -1006,11 +1034,13 @@ def test_get_stories_fallback(client):
'advisory_name': 'RHBA-2017:2251-02',
'content_types': ['docker'],
'created_at': '2017-04-03T14:47:23Z',
'display_name': 'RHBA-2017:2251-02',
'id': '27825',
'issue_date': '2017-08-01T05:59:34Z',
'product_name': 'Red Hat Enterprise Linux',
'product_short_name': 'RHEL',
'release_date': None,
'resource_type': 'Advisory',
'security_impact': 'None',
'security_sla': None,
'state': 'SHIPPED_LIVE',
Expand Down

0 comments on commit a6e2235

Please sign in to comment.