xni/socorro — comment on commit 566f872160db0a4f64b0c91f1b347e3f100f3006
File:  line 0
By twobraids:

r-

this is a good change, but the unit tests need to be updated, too. This change breaks the unittests for the registration.py file. The unittest should really be pretty easy to fix as you just need to adjust the expectations of the mocked database for the queries that you've changed.

FAIL: socorro.unittest.processor.testRegistration.test_assume_new_identity
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/lars/project/mozilla/breakpad/git/socorro/socorro/unittest/processor/testRegistration.py", line 561, in test_assume_new_identity
id = r.assume_new_identity(db_cur, threshold, hostname, 17)
File "/home/lars/project/mozilla/breakpad/git/socorro/socorro/processor/registration.py", line 291, in assume_new_identity
(self.processor_name,))
File "/home/lars/project/mozilla/breakpad/git/socorro/socorro/unittest/testlib/expectations.py", line 22, in f
assert argsExpected == args, "%s expected '%s' arguments\n%s\nbut got\n%s" % (self.name, attribute, argsExpected, args)
AssertionError: expected 'singleValueSql' arguments
(, 'insert into processors (id, name, startdatetime, lastseendatetime) values (default, %s, now(), now()) returning id', ('fred',))
but got
(, "insert into processors (id, name, startdatetime, lastseendatetime) values (default, %s, now() at time zone 'utc', now() at time zone 'utc') returning id", ('fred',))

FAIL: socorro.unittest.processor.testRegistration.test_take_over_dead_processor
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/lars/project/mozilla/breakpad/git/socorro/socorro/unittest/processor/testRegistration.py", line 608, in test_take_over_dead_processor
id = r.take_over_dead_processor(db_cur, 17)
File "/home/lars/project/mozilla/breakpad/git/socorro/socorro/processor/registration.py", line 307, in take_over_dead_processor
(self.processor_name, req_id))
File "/home/lars/project/mozilla/breakpad/git/socorro/socorro/unittest/testlib/expectations.py", line 22, in f
assert argsExpected == args, "%s expected '%s' arguments\n%s\nbut got\n%s" % (self.name, attribute, argsExpected, args)
AssertionError: expected 'execute' arguments
('update processors set name = %s, startdatetime = now(), lastseendatetime = now() where id = %s', ('fred', 17))
but got
("update processors set name = %s, startdatetime = now() at time zone 'utc', lastseendatetime = now() at time zone 'utc'where id = %s", ('fred', 17))