Commit 62d38b4c authored by dimitri.szabo's avatar dimitri.szabo
Browse files

test tsvDivider

parent 112306bf
Pipeline #51977 failed with stage
in 46 seconds
......@@ -20,6 +20,7 @@ setup(
extras_require = {
"dev": [
"pytest>=6.2.5",
"pytest-datadir>=1.3.1"
],
},
entry_points={
......
from cmath import nan
import os
import pytest
import tsv2properties as t2p
import pandas as pd
from tsv2metadata import tsvDivider
# Test Data
test_fields = pd.DataFrame(
{'name':['simpleField', 'controlledField'],
'title':['Simple Field', 'Controlled Field'],
'description': ['Description simpleField', 'Description controlledField']
})
test_vocabularies = {}
def test_tsvDivider():
data_frames = tsvDivider(path_to_tsv="test.tsv")
test_vocabularies = pd.DataFrame(
{'DatasetField':['controlledField', 'controlledField', 'controlledField'],
'Value':['Champ avec id', 'Colonnes supplémentaires', 'ÅÉ Ô éèà'],
'identifier':['id', nan, nan]
})
test_vocabularies.index = [3,4,5]
# Tests
def test_tsvDivider(shared_datadir):
data_frames = t2p.tsvDivider(shared_datadir / 'test.tsv')
fields = data_frames[0]
vocabularies = data_frames[1]
assert fields.equals(test_fields)
assert vocabularies == test_vocabularies
assert vocabularies.equals(test_vocabularies)
def test_extractDatasetFields():
assert 1 != 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment