Merge lp:~sidnei/ubuntuone-dev-tools/memento-handler-merge into lp:ubuntuone-dev-tools

Proposed by Sidnei da Silva
Status: Merged
Approved by: Sidnei da Silva
Approved revision: 63
Merged at revision: 60
Proposed branch: lp:~sidnei/ubuntuone-dev-tools/memento-handler-merge
Merge into: lp:ubuntuone-dev-tools
Diff against target: 51 lines (+20/-10)
1 file modified
ubuntuone/devtools/handlers.py (+20/-10)
To merge this branch: bzr merge lp:~sidnei/ubuntuone-dev-tools/memento-handler-merge
Reviewer Review Type Date Requested Status
dobey (community) Approve
Curtis Caravone (community) Approve
Review via email: mp+100509@code.launchpad.net

Commit message

Merge MementoHandler with the implementation from filesync

Description of the change

Merge MementoHandler with the implementation from filesync

To post a comment you must log in.
Revision history for this message
dobey (dobey) wrote :

Can you file a bug explaining what is wrong with the current code, and commit --fixes=lp:thatbug to link this branch to it? And provide a more explicit commit message of what the changes are. It's also worth noting that this breaks feature/api freeze in Precise, so the changes won't be making it into the packages there, but only in trunk, when this does land. Either way, a bug report would be good to refer to if we need to in the future. Thanks.

review: Needs Information
Revision history for this message
Sidnei da Silva (sidnei) wrote :

On Mon, Apr 2, 2012 at 5:43 PM, Rodney Dawes <email address hidden> wrote:
> Review: Needs Information
>
> Can you file a bug explaining what is wrong with the current code, and commit --fixes=lp:thatbug to link this branch to it? And provide a more explicit commit message of what the changes are. It's also worth noting that this breaks feature/api freeze in Precise, so the changes won't be making it into the packages there, but only in trunk, when this does land. Either way, a bug report would be good to refer to if we need to in the future. Thanks.

There's nothing wrong with the current code. It was just needlessly
duplicated in the ubuntuone-servers test suite, so I'm merging the
additional code from there so there's only one implementation. All but
one test suite in u1-servers are already using the implementation from
ubuntuone-dev-tools.

I'm fine with the changes only being in trunk, since it's being used
as a sourcedep there.

--
Sidnei

Make the most of Ubuntu with Ubuntu One
http://one.ubuntu.com

Revision history for this message
Curtis Caravone (caravone) wrote :

So there will be a follow up branch to make everything reference this version of MementoHandler?

review: Approve
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (11.4 KiB)

The attempt to merge lp:~sidnei/ubuntuone-dev-tools/memento-handler-merge into lp:ubuntuone-dev-tools failed. Below is the output from the failed tests.

ubuntuone.devtools.testcases
  BaseTestCase
    runTest ... [OK]
ubuntuone.devtools.tests.test_decorators
  TestSkipBasicDecorators
    test_skip_class ... [OK]
    test_skip_decorators ... [OK]
ubuntuone.devtools.tests.test_txcheck
  TestCheckTwistedTestClass
    test_bad_mixin_order ... [OK]
    test_bare_super ... [OK]
    test_inline_callbacks ... [OK]
    test_inline_callbacks_missing ... [OK]
    test_missing_return ... [OK]
    test_no_problems ... [OK]
    test_not_twisted ... [OK]
    test_ok_mixin_order ... [OK]
    test_super_not_called ... [OK]
  TestTwistedCheckSuite
    test_suite_catches_problems ... [OK]
    test_suite_runs_tests ... [OK]
twisted.trial.unittest
  TestCase
    runTest ... [OK]
ubuntuone.devtools.testcases.dbus
  DBusTestCase
    runTest ... [OK]
ubuntuone.devtools.services.tests.test_dbus
  TestWithDBus
    test_config_file_path ... [OK]
    test_dbus_session_is_running ... [OK]
ubuntuone.devtools.testcases
  BaseTestCase
    runTest ... [OK]
ubuntuone.devtools.services.tests.test_squid
  EnvironTestCase
    test_delete_proxy_settings_present ... [OK]
    test_retrieve_proxy_settings ... [OK]
    test_store_settings ... [OK]
  PathsTestCase
    test_get_auth_temp_path ... [OK]
    test_get_basedir_missing ... [OK]
    test_get_basedir_present ... [OK]
    test_get_spool_temp_path_missing ... [OK]
    test_get_spool_temp_path_present ... [OK]
    test_get_squid_temp_path_missing ... [OK]
    test_get_squid_temp_path_present ... [OK]
  SquidRunnerInitTestCase
    test_htpasswd_missing ... [OK]
    test_squid_missing ... [OK]
  SquidRunnerTestCase
    test_generate_auth_file ... ...

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (11.3 KiB)

The attempt to merge lp:~sidnei/ubuntuone-dev-tools/memento-handler-merge into lp:ubuntuone-dev-tools failed. Below is the output from the failed tests.

ubuntuone.devtools.testcases
  BaseTestCase
    runTest ... [OK]
ubuntuone.devtools.tests.test_decorators
  TestSkipBasicDecorators
    test_skip_class ... [OK]
    test_skip_decorators ... [OK]
ubuntuone.devtools.tests.test_txcheck
  TestCheckTwistedTestClass
    test_bad_mixin_order ... [OK]
    test_bare_super ... [OK]
    test_inline_callbacks ... [OK]
    test_inline_callbacks_missing ... [OK]
    test_missing_return ... [OK]
    test_no_problems ... [OK]
    test_not_twisted ... [OK]
    test_ok_mixin_order ... [OK]
    test_super_not_called ... [OK]
  TestTwistedCheckSuite
    test_suite_catches_problems ... [OK]
    test_suite_runs_tests ... [OK]
twisted.trial.unittest
  TestCase
    runTest ... [OK]
ubuntuone.devtools.testcases.dbus
  DBusTestCase
    runTest ... [OK]
ubuntuone.devtools.services.tests.test_dbus
  TestWithDBus
    test_config_file_path ... [OK]
    test_dbus_session_is_running ... [OK]
ubuntuone.devtools.testcases
  BaseTestCase
    runTest ... [OK]
ubuntuone.devtools.services.tests.test_squid
  EnvironTestCase
    test_delete_proxy_settings_present ... [OK]
    test_retrieve_proxy_settings ... [OK]
    test_store_settings ... [OK]
  PathsTestCase
    test_get_auth_temp_path ... [OK]
    test_get_basedir_missing ... [OK]
    test_get_basedir_present ... [OK]
    test_get_spool_temp_path_missing ... [OK]
    test_get_spool_temp_path_present ... [OK]
    test_get_squid_temp_path_missing ... [OK]
    test_get_squid_temp_path_present ... [OK]
  SquidRunnerInitTestCase
    test_htpasswd_missing ... [OK]
    test_squid_missing ... [OK]
  SquidRunnerTestCase
    test_generate_auth_file ... ...

63. By Sidnei da Silva

- Whitespace

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/devtools/handlers.py'
2--- ubuntuone/devtools/handlers.py 2012-03-30 17:44:03 +0000
3+++ ubuntuone/devtools/handlers.py 2012-04-04 19:17:29 +0000
4@@ -48,15 +48,25 @@
5 self.format(record)
6 self.records.append(record)
7
8+ def dump_contents(self, msgs):
9+ """Dumps the contents of the MementoHandler."""
10+ if self.debug:
11+ print "Expecting:"
12+ for msg in msgs:
13+ print "\t", msg
14+ print "MementoHandler contents:"
15+ for rec in self.records:
16+ print "\t", rec.exc_info
17+ print "\t", logging.getLevelName(rec.levelno)
18+ print "\t\t", rec.message
19+ print "\t\t", rec.exc_text
20+
21 def check(self, level, *msgs):
22- """Verifies that the msgs are logged in the specified level."""
23+ """Verifies that the msgs are logged in the specified level"""
24 for rec in self.records:
25 if rec.levelno == level and all(m in rec.message for m in msgs):
26- return True
27- if self.debug:
28- recorded = [(logging.getLevelName(r.levelno), r.message)
29- for r in self.records]
30- print "Memento messages:", recorded
31+ return rec
32+ self.dump_contents(msgs)
33 return False
34
35 def check_debug(self, *msgs):
36@@ -75,11 +85,11 @@
37 """Shortcut for checking in ERROR."""
38 return self.check(logging.ERROR, *msgs)
39
40- def check_exception(self, exception_class, *msgs):
41+ def check_exception(self, exception_info, *msgs):
42 """Shortcut for checking exceptions."""
43 for rec in self.records:
44- if rec.levelno == logging.ERROR and \
45- all(m in rec.exc_text for m in msgs) and \
46- exception_class == rec.exc_info[0]:
47+ if (rec.levelno == logging.ERROR and
48+ all(m in rec.exc_text + rec.message for m in msgs) and
49+ exception_info in rec.exc_info):
50 return True
51 return False

Subscribers

People subscribed via source and target branches

to all changes: