* [MO] Add support to moc_frontend of ":" as delimiter for --input Additions: Changed default logic for 'Place::get_in(out)put_port' to return nullptr Changed default logic for 'InputModel::get_place_by_tensor(operation)_name' to return nullptr * Corrected comments in code * Missing empty line * Clang format fixes * Fix review comments * Updated test to verify review comments fixes * Update unit tests after rebase * Apply review comments
53 lines
1.5 KiB
Python
53 lines
1.5 KiB
Python
# Copyright (C) 2018-2021 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import logging as log
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
import unittest
|
|
from unittest.mock import patch
|
|
|
|
from mo.subprocess_main import setup_env, subprocess_main
|
|
|
|
import pytest
|
|
|
|
|
|
class TestNoInferenceEngine(unittest.TestCase):
|
|
@patch('mo.utils.find_ie_version.find_ie_version')
|
|
def test_no_ie_ngraph(self, mock_find):
|
|
mock_find.return_value = False
|
|
with pytest.raises(SystemExit) as e, self.assertLogs(log.getLogger(), level="ERROR") as cm:
|
|
subprocess_main()
|
|
assert e.value.code == 1
|
|
res = [i for i in cm.output if
|
|
'Consider building the Inference Engine and nGraph Python APIs from sources' in i]
|
|
assert res
|
|
|
|
|
|
def test_frontends():
|
|
setup_env()
|
|
args = [sys.executable, '-m', 'pytest',
|
|
os.path.join(os.path.dirname(__file__), 'frontend_ngraph_test_actual.py'), '-s']
|
|
|
|
status = subprocess.run(args, env=os.environ)
|
|
assert not status.returncode
|
|
|
|
|
|
def test_moc_extractor():
|
|
setup_env()
|
|
args = [sys.executable, '-m', 'pytest',
|
|
os.path.join(os.path.dirname(__file__), 'moc_frontend/moc_extractor_test_actual.py'), '-s']
|
|
|
|
status = subprocess.run(args, env=os.environ)
|
|
assert not status.returncode
|
|
|
|
|
|
def test_main_test():
|
|
setup_env()
|
|
args = [sys.executable, '-m', 'pytest',
|
|
os.path.join(os.path.dirname(__file__), 'main_test_actual.py'), '-s']
|
|
|
|
status = subprocess.run(args, env=os.environ)
|
|
assert not status.returncode
|