def api_rule(uuid): if flask.request.method == 'GET': rule = rules.get(uuid) return flask.jsonify(rule_repr(rule, short=False)) else: rules.delete(uuid) return '', 204
def api_rule(uuid): if flask.request.method == 'GET': rule = rules.get(uuid) return flask.jsonify(rule_repr(rule, short=False)) else: rules.delete(uuid) return _generate_empty_response(204)
def test_get(self): rule_json = rules.get(self.uuid).as_dict() self.assertTrue(rule_json.pop(self.uuid)) self.assertEqual({'description': None, 'conditions': self.conditions_json, 'actions': self.actions_json}, rule_json)
def api_rule(uuid): utils.check_auth(flask.request) if flask.request.method == 'GET': rule = rules.get(uuid) return flask.jsonify(rule_repr(rule, short=False)) else: rules.delete(uuid) return '', 204
def test_get(self): rule_json = rules.get(self.uuid).as_dict() self.assertTrue(rule_json.pop('uuid')) self.assertEqual( { 'description': None, 'conditions': self.conditions_json, 'actions': self.actions_json }, rule_json)
def test_get(self): rule_json = rules.get(self.uuid).as_dict() self.assertTrue(rule_json.pop('uuid')) self.assertEqual( { 'description': None, 'conditions': [ BaseTest.condition_defaults(cond) for cond in self.conditions_json ], 'actions': self.actions_json }, rule_json)