# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
# Copyright 2021 Dell (www.dell.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


import unittest
from dell_runtime import DellRuntimeProvider, BackendProvider

class ProviderTest(unittest.TestCase):
    def test_new_provider(self):
        provider = DellRuntimeProvider()
        self.assertIsNotNone(provider)
        provider = BackendProvider()
        self.assertIsNotNone(provider)

    def test_backends(self):
        provider = BackendProvider()
        self.assertIsNotNone(provider)

        self.assertGreater(len(provider.backends()), 1)

    def test_runtime_supported(self):
        provider = DellRuntimeProvider()
        self.assertIsNotNone(provider)

        self.assertTrue(provider.has_service('runtime'))
        self.assertFalse(provider.has_service('weird_service'))

    def test_has_runtime_attribute(self):
        provider = DellRuntimeProvider()
        self.assertIsNotNone(provider)

        self.assertIsNotNone(provider.runtime)


# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
# Copyright 2021 Dell (www.dell.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


import unittest
from dell_runtime import DellRuntimeProvider, BackendProvider

class ProviderTest(unittest.TestCase):
    def test_new_provider(self):
        provider = DellRuntimeProvider()
        self.assertIsNotNone(provider)
        provider = BackendProvider()
        self.assertIsNotNone(provider)

    def test_backends(self):
        provider = BackendProvider()
        self.assertIsNotNone(provider)

        self.assertGreater(len(provider.backends()), 1)

    def test_runtime_supported(self):
        provider = DellRuntimeProvider()
        self.assertIsNotNone(provider)

        self.assertTrue(provider.has_service('runtime'))
        self.assertFalse(provider.has_service('weird_service'))

    def test_has_runtime_attribute(self):
        provider = DellRuntimeProvider()
        self.assertIsNotNone(provider)

        self.assertIsNotNone(provider.runtime)


# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative works of this code must retain this # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. # Copyright 2021 Dell (www.dell.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.