On null changes serialize the id as null

Currently it's serialized as "None" (the string).

Change-Id: I75a8aeb6b11d5700f03baef95527016877ff8f92
This commit is contained in:
Alex Gaynor 2013-09-16 21:04:58 -07:00
parent fba9b247bf
commit ddb9ef30dc
2 changed files with 2 additions and 5 deletions

View File

@ -2558,7 +2558,7 @@ class TestScheduler(testtools.TestCase):
for q in p['change_queues']: for q in p['change_queues']:
for head in q['heads']: for head in q['heads']:
for change in head: for change in head:
self.assertEqual(change['id'], 'None') self.assertEqual(change['id'], None)
for job in change['jobs']: for job in change['jobs']:
status_jobs.add(job['name']) status_jobs.add(job['name'])
self.assertIn('project-bitrot-stable-old', status_jobs) self.assertIn('project-bitrot-stable-old', status_jobs)

View File

@ -722,11 +722,8 @@ class Ref(Changeish):
class NullChange(Changeish): class NullChange(Changeish):
is_reportable = False is_reportable = False
def __init__(self, project):
super(NullChange, self).__init__(project)
def _id(self): def _id(self):
return 'None' return None
def equals(self, other): def equals(self, other):
return False return False