File: test_bad_data.py

package info (click to toggle)
python-internetarchive 1.8.1-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 832 kB
  • sloc: python: 4,646; makefile: 180; xml: 180
file content (12 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
from internetarchive.api import get_item
from tests.conftest import IaRequestsMock


def test_bad_mediatype():
    # this identifier actually has this malformed data
    ident = 'CIA-RDP96-00789R000700210007-5'
    body = '{"metadata": {"mediatype":["texts","texts"]}}'
    with IaRequestsMock() as rsps:
        rsps.add_metadata_mock(ident, body=body)
        # should complete without error
        get_item(ident)