@@ -58,7 +58,7 @@ def post(url,data,headers,auth):
5858 else :
5959 return Resp (None ,202 )
6060
61-
61+
6262
6363message .requests .post = post
6464
@@ -72,23 +72,23 @@ def patch(url,data,headers,auth):
7272 if headers ['Content-type' ] != 'application/json' :
7373 raise
7474 if headers ['Accept' ] != 'application/json' :
75- raise
75+ raise
7676 return True
7777
7878message .requests .patch = patch
7979
8080auth = ('test@unit.com' ,'pass' )
8181
8282class TestMessage (unittest .TestCase ):
83-
83+
8484 def setUp (self ):
8585 ur = json .loads (un_rep )['value' ][0 ]
8686 self .unread = message .Message (ur ,auth )
8787 re = json .loads (read_rep )['value' ][0 ]
8888 self .read = message .Message (re ,auth )
8989 att = json .loads (att_m_rep )['value' ][0 ]
9090 self .att = message .Message (att ,auth )
91-
91+
9292 self .newm = message .Message (auth = auth )
9393
9494 def test_fetchAttachments (self ):
@@ -117,6 +117,9 @@ def test_sendMessage(self):
117117 def test_markAsRead (self ):
118118 self .unread .markAsRead ()
119119
120+ def test_setCategories (self ):
121+ self .unread .setCategories (["Green" , "Yellow" ])
122+
120123 def test_setRecipients (self ):
121124 self .assertTrue (len (self .read .json ['ToRecipients' ]) == 1 )
122125 self .assertTrue (len (self .unread .json ['ToRecipients' ]) == 1 )
@@ -125,7 +128,7 @@ def test_setRecipients(self):
125128 self .read .setRecipients ('bob@unit.com' )
126129 self .assertTrue (self .read .json ['ToRecipients' ][0 ]['EmailAddress' ]['Address' ] == 'bob@unit.com' )
127130
128- self .unread .setRecipients ({'EmailAddress' :{'Address' :'bob@unit.com' ,'Name' :'What about' }})
131+ self .unread .setRecipients ({'EmailAddress' :{'Address' :'bob@unit.com' ,'Name' :'What about' }})
129132 self .assertTrue (self .unread .json ['ToRecipients' ][0 ]['EmailAddress' ]['Address' ] == 'bob@unit.com' )
130133 self .assertTrue (self .unread .json ['ToRecipients' ][0 ]['EmailAddress' ]['Name' ] == 'What about' )
131134
0 commit comments