def test_set_header(self):
     notification = RawNotification(self.TEST_URI)
     notification._setHeader('foo', 'bar')
     self.assertEqual(notification.requestHeaders['foo'], ['bar'])
 def test_class_header_raw_high_priority(self):
     notification = RawNotification(self.TEST_URI,
                                    priority=DELIVER_IMMEDIATELY)
     self.assertEqual(notification._classHeader(), '3')
Exemple #3
0
 def test_class_header_raw_high_priority(self):
     notification = RawNotification(self.TEST_URI,
                                    priority=DELIVER_IMMEDIATELY)
     self.assertEqual(notification._classHeader(), '3')
Exemple #4
0
 def test_target_header_raw(self):
     notification = RawNotification(self.TEST_URI)
     self.assertFalse(
         'X-WindowsPhone-Target' in notification.requestHeaders)
Exemple #5
0
 def test_class_header_nonexisting(self):
     with self.assertRaises(NotificationError):
         RawNotification(self.TEST_URI, priority=999)
Exemple #6
0
 def test_set_header(self):
     notification = RawNotification(self.TEST_URI)
     notification._setHeader('foo', 'bar')
     self.assertEqual(notification.requestHeaders['foo'], ['bar'])
Exemple #7
0
 def test_body_defined(self):
     notification = RawNotification(self.TEST_URI, body='foo')
     self.assertEqual(notification.requestBody, 'foo')
Exemple #8
0
 def test_body_empty(self):
     notification = RawNotification(self.TEST_URI)
     self.assertEqual(notification.requestBody, None)
Exemple #9
0
 def test_uri(self):
     notification = RawNotification(self.TEST_URI)
     self.assertEqual(notification.requestUri, self.TEST_URI)