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