File: test_invalid.py

package info (click to toggle)
python-dom-toml 2.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,936 kB
  • sloc: python: 1,360; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# stdlib
from datetime import time, timezone

# 3rd party
import pytest

# this package
import dom_toml


def test_invalid_type_nested():
	with pytest.raises(TypeError):
		dom_toml.dumps({"bytearr": bytearray()})


def test_invalid_time():
	offset_time = time(23, 59, 59, tzinfo=timezone.utc)
	with pytest.raises(ValueError, match="TOML does not support offset times"):
		dom_toml.dumps({"offset time": offset_time})