File: test_dictionary.py

package info (click to toggle)
python-av 14.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,664 kB
  • sloc: python: 4,712; sh: 175; ansic: 174; makefile: 123
file content (17 lines) | stat: -rw-r--r-- 337 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import pytest

from av.dictionary import Dictionary


def test_dictionary() -> None:
    d = Dictionary()
    d["key"] = "value"

    assert d["key"] == "value"
    assert "key" in d
    assert len(d) == 1
    assert list(d) == ["key"]

    assert d.pop("key") == "value"
    pytest.raises(KeyError, d.pop, "key")
    assert len(d) == 0