File: test_b_create_vocab.py

package info (click to toggle)
python-pyomop 4.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 532 kB
  • sloc: python: 1,374; sh: 37; makefile: 26
file content (44 lines) | stat: -rw-r--r-- 1,034 bytes parent folder | download
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
35
36
37
38
39
40
41
42
43
44
import asyncio
import pytest

@staticmethod
def test_create_tables(pyomop_fixture, metadata_fixture, capsys):
    engine = pyomop_fixture.engine
    # create tables
    asyncio.run(pyomop_fixture.init_models(metadata_fixture))

def test_create_vocab(pyomop_fixture, metadata_fixture, capsys):
    engine = pyomop_fixture.engine
    create_vocab(pyomop_fixture, engine)

def create_vocab(pyomop_fixture,engine):
    from pyomop import CdmVocabulary
    vocab = CdmVocabulary(pyomop_fixture)
    vocab.create_vocab('tests', 10)
    print("Done")







# import pytest
# import os

# @pytest.fixture
# def pyomop_fixture():
#     from src.pyomop import CdmEngineFactory
#     cdm = CdmEngineFactory()
#     return cdm

# @pytest.fixture
# def metadata_fixture():
#     from src.pyomop import metadata
#     return metadata

# def test_create_vocab(pyomop_fixture, metadata_fixture, capsys):
#     from src.pyomop import CdmVocabulary
#     vocab = CdmVocabulary(pyomop_fixture)
#     vocab.create_vocab('tests', 10)
#     print("Done")