File: test_bad_data.py

package info (click to toggle)
python-internetarchive 5.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,000 kB
  • sloc: python: 7,445; xml: 180; makefile: 180
file content (12 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (4)
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)