~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/mail/tests/test_helpers.py

  • Committer: Curtis Hovey
  • Date: 2011-08-11 22:37:09 UTC
  • mto: This revision was merged to the branch mainline in revision 13685.
  • Revision ID: curtis.hovey@canonical.com-20110811223709-oe3dytlpvv3jm27p
Hushed lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
        one_week = 60 * 60 * 24 * 7
101
101
        self.assertRaises(
102
102
            IncomingEmailError, ensure_sane_signature_timestamp,
103
 
            now-one_week, 'bug report')
 
103
            now - one_week, 'bug report')
104
104
 
105
105
    def test_future_timestamp(self):
106
106
        # signature timestamps shouldn't be (far) in the future
108
108
        one_week = 60 * 60 * 24 * 7
109
109
        self.assertRaises(
110
110
            IncomingEmailError, ensure_sane_signature_timestamp,
111
 
            now+one_week, 'bug report')
 
111
            now + one_week, 'bug report')
112
112
 
113
113
    def test_near_future_timestamp(self):
114
114
        # signature timestamps in the near future are OK
115
115
        now = time.time()
116
116
        one_minute = 60
117
117
        # this should not raise an exception
118
 
        ensure_sane_signature_timestamp(now+one_minute, 'bug report')
 
118
        ensure_sane_signature_timestamp(now + one_minute, 'bug report')
119
119
 
120
120
    def test_recent_timestamp(self):
121
121
        # signature timestamps in the recent past are OK
122
122
        now = time.time()
123
123
        one_hour = 60 * 60
124
124
        # this should not raise an exception
125
 
        ensure_sane_signature_timestamp(now-one_hour, 'bug report')
 
125
        ensure_sane_signature_timestamp(now - one_hour, 'bug report')
126
126
 
127
127
 
128
128
class TestEnsureNotWeaklyAuthenticated(TestCaseWithFactory):