@defer.inlineCallbacks
    def test_send_with_priority(self):
        params = {'username': self.username,
                  'password': 'correct',
                  'to': '06155423',
                  'content': 'anycontent'}

        # Priority definitions
        valid_priorities = {0, 1, 2, 3}

        for params['priority'] in valid_priorities:
            response = yield self.web.get("send", params)
            self.assertEqual(response.responseCode, 500)

            # This is a normal error since SMPPClientManagerPB is not really running
            self.assertEqual(response.value(), "Error \"Cannot send submit_sm, check SMPPClientManagerPB log file for details\"")

        # Priority definitions
        invalid_priorities = {-1, 'a', 44, 4}

        for params['priority'] in invalid_priorities:
            response = yield self.web.get("send", params)

            self.assertEqual(response.responseCode, 400)
            # This is a normal error since SMPPClientManagerPB is not really running
            self.assertEqual(response.value(), params['priority'] % 'Error "Argument [priority] has an invalid value: [%s]."')
dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/http/test/test_server.py/SendTestCases.test_send_with_priority/swapped operands of `%`