Пример #1
0
 def test_from_response_should_not_map_typo_exerpt_property(self):
     mail = Mail.from_response({'mail_exerpt': 'A brief message....'})
     mail = Mail.from_response({'mail_excerpt': 'A brief message....'})
     expect(mail.exerpt).to.be.none
Пример #2
0
 def test_from_response_should_default_exerpt_to_none(self):
     mail = Mail.from_response({})
     expect(mail.exerpt).to.be.none
Пример #3
0
 def test_from_response_should_default_body_to_none(self):
     mail = Mail.from_response({})
     expect(mail.body).to.be.none
Пример #4
0
 def test_from_response_should_default_read_to_false(self):
     mail = Mail.from_response({})
     expect(mail.read).to.be.false
Пример #5
0
 def test_from_response_should_default_datetime_to_none(self):
     mail = Mail.from_response({})
     expect(mail.datetime).to.be.none
Пример #6
0
 def test_from_response_should_default_sender_to_none(self):
     mail = Mail.from_response({})
     expect(mail.sender).to.be.none
Пример #7
0
 def test_from_response_should_default_guid_to_none(self):
     mail = Mail.from_response({})
     expect(mail.guid).to.be.none
Пример #8
0
 def test_from_response_should_default_guid_to_none(self):
     mail = Mail.from_response({})
     expect(mail.guid).to.be.none
Пример #9
0
 def test_from_response_should_map_read_as_bool_true(self):
     mail = Mail.from_response({'mail_read': '1'})
     expect(mail.read).to.be.true
Пример #10
0
 def test_from_response_should_default_sender_to_none(self):
     mail = Mail.from_response({})
     expect(mail.sender).to.be.none
Пример #11
0
 def test_from_response_should_map_guid(self):
     mail = Mail.from_response({'mail_id': '12345'})
     expect(mail.guid).to.equal('12345')
Пример #12
0
 def test_from_response_should_map_sender(self):
     mail = Mail.from_response({'mail_from': '*****@*****.**'})
     expect(mail.sender).to.equal('*****@*****.**')
Пример #13
0
 def test_from_response_should_map_subject(self):
     mail = Mail.from_response({'mail_subject': 'Hello'})
     expect(mail.subject).to.equal('Hello')
Пример #14
0
 def test_from_response_should_ignore_unknown_properties(self):
     mail = Mail.from_response({
         "mail_recipient": "john",
     })
     expect(mail).to.not_have.property('recipient')
Пример #15
0
 def test_from_response_should_map_subject(self):
     mail = Mail.from_response({'mail_subject': 'Hello'})
     expect(mail.subject).to.equal('Hello')
Пример #16
0
 def test_from_response_should_default_read_to_false(self):
     mail = Mail.from_response({})
     expect(mail.read).to.be.false
Пример #17
0
 def test_from_response_should_map_sender(self):
     mail = Mail.from_response({'mail_from': '*****@*****.**'})
     expect(mail.sender).to.equal('*****@*****.**')
Пример #18
0
 def test_from_response_should_map_datetime(self):
     mail = Mail.from_response({'mail_timestamp': '1392459985'})
     expect(mail.datetime).to.equal(
         datetime(2014, 2, 15, 10, 26, 25, tzinfo=utc))
Пример #19
0
 def test_from_response_should_map_guid(self):
     mail = Mail.from_response({'mail_id': '12345'})
     expect(mail.guid).to.equal('12345')
Пример #20
0
 def test_from_response_should_default_datetime_to_none(self):
     mail = Mail.from_response({})
     expect(mail.datetime).to.be.none
Пример #21
0
 def test_from_response_should_map_read_as_bool_true(self):
     mail = Mail.from_response({'mail_read': '1'})
     expect(mail.read).to.be.true
Пример #22
0
 def test_from_response_should_map_exeprt(self):
     mail = Mail.from_response({'mail_exerpt': 'A brief message....'})
     expect(mail.exerpt).to.equal('A brief message....')
Пример #23
0
 def test_from_response_should_map_datetime(self):
     mail = Mail.from_response({'mail_timestamp': '1392459985'})
     expect(mail.datetime).to.equal(datetime(2014, 2, 15, 10, 26, 25, tzinfo=utc))
Пример #24
0
 def test_from_response_should_default_exerpt_to_none(self):
     mail = Mail.from_response({})
     expect(mail.exerpt).to.be.none
Пример #25
0
 def test_from_response_should_map_exeprt(self):
     mail = Mail.from_response({'mail_exerpt': 'A brief message....'})
     expect(mail.exerpt).to.equal('A brief message....')
Пример #26
0
 def test_from_response_should_map_body(self):
     mail = Mail.from_response(
         {'mail_body': 'A brief message from our sponsors'})
     expect(mail.body).to.equal('A brief message from our sponsors')
Пример #27
0
 def test_from_response_should_map_body(self):
     mail = Mail.from_response({'mail_body': 'A brief message from our sponsors'})
     expect(mail.body).to.equal('A brief message from our sponsors')
Пример #28
0
 def test_from_response_should_default_body_to_none(self):
     mail = Mail.from_response({})
     expect(mail.body).to.be.none
Пример #29
0
 def test_from_response_should_ignore_unknown_properties(self):
     mail = Mail.from_response({
         "mail_recipient": "john",
     })
     expect(mail).to.not_have.property('recipient')
Пример #30
0
 def test_from_response_should_not_map_typo_exerpt_property(self):
     mail = Mail.from_response({'mail_exerpt': 'A brief message....'})
     mail = Mail.from_response({'mail_excerpt': 'A brief message....'})
     expect(mail.exerpt).to.be.none