# CONFIDENTIAL. (C) 2017 OpenEye Scientific Software Inc.
# All rights reserved.
#
# ALL SOFTWARE BELOW IS PROPRIETARY AND CONFIDENTIAL TO OPENEYE
# SCIENTIFIC SOFTWARE INC., AND IS SUBJECT TO THE FULL PROTECTION OF
# COPYRIGHT AND TRADESECRET LAW.
# Copying or modifying this software is strictly prohibited and illegal.
# Using this software without a valid license from OpenEye is strictly
# prohibited and illegal. De-obfuscating, de-minimizing, or any other
# attempt to reverse engineer or discover the workings of this software,
# is strictly prohibited. Even if software is exposed or visible, it is
# still proprietary and confidential and the above prohibitions apply.
# This software is NOT "Sample Code". For purposes of customization or
# interoperation with other software you must use Sample Code
# specifically labeled as such.
# Please contact OpenEye at eyesopen.com/legal if you have any questions
# about this warning.
"""
 Test suite for Omega TK examples
"""

import pytest
from . import OETestCase, check_license, check_fastomega


@pytest.mark.skipif(check_license('omega') is False, reason='OMEGA license not found')
class TestOmega(OETestCase):

    def test_omega(self):
        script = self.run_example(
            '{0}/omega/simple_omega.py'.format(self.EXAMPLES_DIR),
            '{0}/data3d.sdf.gz'.format(self.DATA_DIR), 'simpleomega.oeb.gz',
            expect_stderr=True)
        self.assertFalse(script.returncode)
    
    @pytest.mark.skipif(check_fastomega() is False, reason='No CUDA-capable devices were detected!')
    def test_fastomega(self):
        script = self.run_example(
            '{0}/omega/simple_omega.py'.format(self.EXAMPLES_DIR),
            '-in', '{0}/data3d.sdf.gz'.format(self.DATA_DIR),
            '-out', 'simpleomega.oeb.gz',
            '-useGPU', 'true',
            expect_stderr=True)
        self.assertFalse(script.returncode)
