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

        # Validity period definitions
        valid_vps = {0, 1, 2, 3, 4000}

        for params['validity-period'] in valid_vps:
            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\"")

        # Validity period definitions
        invalid_vps = {-1, 'a', 1.0}

        for params['validity-period'] in invalid_vps:
            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['validity-period'] % 'Error "Argument [validity-period] has an invalid value: [%s]."')
dataset/ETHPy150Open jookies/jasmin/jasmin/protocols/http/test/test_server.py/SendTestCases.test_send_with_validity_period/swapped operands of `%`