-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_apis.py
34 lines (31 loc) · 877 Bytes
/
test_apis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pytest
from pathlib import Path
from refpapers.schema import Paper, BibtexKey
from refpapers.apis import paper_from_metadata
@pytest.mark.parametrize(
'inp,expected',
[
(
{
'authors': ['foo'],
'year': 2022,
'title': 'an example title here',
},
Paper(
path=Path('.'),
bibtex=BibtexKey(author='foo', year=2022, word='example'),
title='an example title here',
authors=('foo',),
year=2022,
pub_type=(),
tags=(),
number=None,
doi=None,
arxiv=None,
),
),
],
)
def test_paper_from_metadata(inp, expected):
result = paper_from_metadata(inp, path=Path('.'))
assert result == expected