File: test_args.py

package info (click to toggle)
python-wsme 0.12.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 616 kB
  • sloc: python: 6,064; makefile: 27; javascript: 8
file content (20 lines) | stat: -rw-r--r-- 522 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import mock
import unittest

from wsme import exc
from wsme.rest import args
from wsme.rest import json


class TestArgs(unittest.TestCase):

    def test_args_from_body(self):

        funcdef = mock.MagicMock()
        body = mock.MagicMock()
        mimetype = "application/json"
        funcdef.ignore_extra_args = True
        json.parse = mock.MagicMock()
        json.parse.side_effect = (exc.UnknownArgument(""))
        resp = args.args_from_body(funcdef, body, mimetype)
        self.assertEqual(resp, ((), {}))