* We do the following several times:
'SSOLogin: emitting CaptchaGenerated with app_name "%s" and result %r', app_name, result
'SSOLogin: emitting CaptchaGenerationError with app_name "%s" and error %r', app_name, error
is it possible to be smarter regarding the logging of the DBusSignals? an idea would be to use a decorator that way we know the function name and the args. I think it will remove some noise form the code.
* I'm confused, why do we have the following?:
1218 + d.addCallback(lambda a: reply_handler(*a))
If a is not a sequence we are going to have a runtime error..
Major branch!!! here are some things I'v noticed:
* We do the following several times: onError with app_name "%s" and error %r', app_name, error
'SSOLogin: emitting CaptchaGenerated with app_name "%s" and result %r', app_name, result
'SSOLogin: emitting CaptchaGenerati
is it possible to be smarter regarding the logging of the DBusSignals? an idea would be to use a decorator that way we know the function name and the args. I think it will remove some noise form the code.
* I'm confused, why do we have the following?:
1218 + d.addCallback( lambda a: reply_handler(*a))
If a is not a sequence we are going to have a runtime error..
* There are several tests of the type:
2869 + def test_credential s_cleared( self): CredentialsClea red(APP_ NAME) __class_ _.__name_ _, CredentialsClea red.__name_ _, APP_NAME) (self.memento. check_info( *msgs))
2870 + """The CredentialsCleared signal."""
2871 + self.obj.
2872 + msgs = (self.obj.
2873 + self.obj.
2874 + self.assertTrue
Where we call a signal, build the msg and assert, can those be merged?
There seems to be some repetitive code here:
2583 + def test_credential s_found_ when_ref_ count_is_ not_positive( self): CredentialsFoun d(APP_NAME, TOKEN) l(self. obj.ref_ count, 0) (self.memento. check_warning( msg)) s_not_found_ when_ref_ count_is_ not_positive( self): CredentialsNotF ound(APP_ NAME) l(self. obj.ref_ count, 0) (self.memento. check_warning( msg)) s_cleared_ when_ref_ count_is_ not_positive( self): CredentialsClea red(APP_ NAME) l(self. obj.ref_ count, 0) (self.memento. check_warning( msg)) s_stored_ when_ref_ count_is_ not_positive( self): CredentialsStor ed(APP_ NAME) l(self. obj.ref_ count, 0) (self.memento. check_warning( msg)) s_error_ when_ref_ count_is_ not_positive( self): CredentialsErro r(APP_NAME, SampleException ('test' )) l(self. obj.ref_ count, 0) (self.memento. check_warning( msg)) on_denied_ when_ref_ count_is_ not_positive( self): AuthorizationDe nied(APP_ NAME) l(self. obj.ref_ count, 0) (self.memento. check_warning( msg))
2584 + """Ref counter is decreased when a signal is sent."""
2585 + self.obj._ref_count = -3
2586 + self.obj.
2587 +
2588 + self.assertEqua
2589 + msg = 'Attempting to decrease ref_count to a negative value (-4).'
2590 + self.assertTrue
2591 +
2592 + def test_credential
2593 + """Ref counter is decreased when a signal is sent."""
2594 + self.obj._ref_count = -3
2595 + self.obj.
2596 +
2597 + self.assertEqua
2598 + msg = 'Attempting to decrease ref_count to a negative value (-4).'
2599 + self.assertTrue
2600 +
2601 + def test_credential
2602 + """Ref counter is decreased when a signal is sent."""
2603 + self.obj._ref_count = -3
2604 + self.obj.
2605 +
2606 + self.assertEqua
2607 + msg = 'Attempting to decrease ref_count to a negative value (-4).'
2608 + self.assertTrue
2609 +
2610 + def test_credential
2611 + """Ref counter is decreased when a signal is sent."""
2612 + self.obj._ref_count = -3
2613 + self.obj.
2614 +
2615 + self.assertEqua
2616 + msg = 'Attempting to decrease ref_count to a negative value (-4).'
2617 + self.assertTrue
2618 +
2619 + def test_credential
2620 + """Ref counter is decreased when a signal is sent."""
2621 + self.obj._ref_count = -3
2622 + self.obj.
2623 +
2624 + self.assertEqua
2625 + msg = 'Attempting to decrease ref_count to a negative value (-4).'
2626 + self.assertTrue
2627 +
2628 + def test_autorizati
2629 + """Ref counter is decreased when a signal is sent."""
2630 + self.obj._ref_count = -3
2631 + self.obj.
2632 +
2633 + self.assertEqua
2634 + msg = 'Attempting to decrease ref_count to a negative value (-4).'
2635 + self.assertTrue
It seems that the diff is the signal that is called. The same applies to:
2541 + def test_credential s_found( self): CredentialsFoun d(APP_NAME, TOKEN) l(self. obj.ref_ count, 2) s_not_found( self): CredentialsNotF ound(APP_ NAME) l(self. obj.ref_ count, 2) s_cleared( self): CredentialsClea red(APP_ NAME) l(self. obj.ref_ count, 2) s_stored( self): CredentialsStor ed(APP_ NAME) l(self. obj.ref_ count, 2) s_error( self): CredentialsErro r(APP_NAME, SampleException ('test' )) l(self. obj.ref_ count, 2) ion_denied( self): AuthorizationDe nied(APP_ NAME) l(self. obj.ref_ count, 2)
2542 + """Ref counter is decreased when a signal is sent."""
2543 + self.obj.ref_count = 3
2544 + self.obj.
2545 +
2546 + self.assertEqua
2547 +
2548 + def test_credential
2549 + """Ref counter is decreased when a signal is sent."""
2550 + self.obj.ref_count = 3
2551 + self.obj.
2552 +
2553 + self.assertEqua
2554 +
2555 + def test_credential
2556 + """Ref counter is decreased when a signal is sent."""
2557 + self.obj.ref_count = 3
2558 + self.obj.
2559 +
2560 + self.assertEqua
2561 +
2562 + def test_credential
2563 + """Ref counter is decreased when a signal is sent."""
2564 + self.obj.ref_count = 3
2565 + self.obj.
2566 +
2567 + self.assertEqua
2568 +
2569 + def test_credential
2570 + """Ref counter is decreased when a signal is sent."""
2571 + self.obj.ref_count = 3
2572 + self.obj.
2573 +
2574 + self.assertEqua
2575 +
2576 + def test_authorizat
2577 + """Ref counter is decreased when a signal is sent."""
2578 + self.obj.ref_count = 3
2579 + self.obj.
2580 +
2581 + self.assertEqua