You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ORPA-pyOpenRPA/Resources/WPy64-3720/python-3.7.2.amd64/Lib/site-packages/nbconvert/filters/tests/test_metadata.py

20 lines
615 B

from nbconvert.filters import get_metadata
def test_get_metadata():
output = {
'metadata': {
'width': 1,
'height': 2,
'image/png': {
'unconfined': True,
'height': 3,
}
}
}
assert get_metadata(output, 'nowhere') is None
assert get_metadata(output, 'height') == 2
assert get_metadata(output, 'unconfined') == None
assert get_metadata(output, 'unconfined', 'image/png') == True
assert get_metadata(output, 'width', 'image/png') == 1
assert get_metadata(output, 'height', 'image/png') == 3