Files
oopt-gnpy-api/tests/test_api.py
Renato Ambrosone e48f524d1a refactor: API now rely on gnpy function without re-implementation
Change-Id: Ib71f62f74eaa9fd87606a977f1f2c830b71668d9
2025-03-25 16:04:49 +01:00

23 lines
670 B
Python

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: Esther Le Rouzic
# @Date: 2025-02-03
from pathlib import Path
import subprocess
import pytest # noqa: F401
YANG_DIR = Path(__file__).parent.parent / 'gnpyapi' / 'yang'
SAMPLE_DIR = Path(__file__).parent.parent / 'samples'
def test_pyang():
"""Verify that yang models pss pyang
"""
res = subprocess.run(['pyang', '-f', 'tree', '--tree-line-length', '69',
'-p', YANG_DIR, YANG_DIR / 'gnpy-api@2021-01-06.yang'],
stdout=subprocess.PIPE, check=True)
if res.returncode != 0:
assert False, f'pyang failed: exit code {res.returncode}'