Skip to content
Snippets Groups Projects
Select Git revision
  • 42c0d4e88994e2e5a6e806a0da82f8ee8b40dff1
  • master default protected
  • L2SS-1914-fix_job_dispatch
  • TMSS-3170
  • TMSS-3167
  • TMSS-3161
  • TMSS-3158-Front-End-Only-Allow-Changing-Again
  • TMSS-3133
  • TMSS-3319-Fix-Templates
  • test-fix-deploy
  • TMSS-3134
  • TMSS-2872
  • defer-state
  • add-custom-monitoring-points
  • TMSS-3101-Front-End-Only
  • TMSS-984-choices
  • SDC-1400-Front-End-Only
  • TMSS-3079-PII
  • TMSS-2936
  • check-for-max-244-subbands
  • TMSS-2927---Front-End-Only-PXII
  • Before-Remove-TMSS
  • LOFAR-Release-4_4_318 protected
  • LOFAR-Release-4_4_317 protected
  • LOFAR-Release-4_4_316 protected
  • LOFAR-Release-4_4_315 protected
  • LOFAR-Release-4_4_314 protected
  • LOFAR-Release-4_4_313 protected
  • LOFAR-Release-4_4_312 protected
  • LOFAR-Release-4_4_311 protected
  • LOFAR-Release-4_4_310 protected
  • LOFAR-Release-4_4_309 protected
  • LOFAR-Release-4_4_308 protected
  • LOFAR-Release-4_4_307 protected
  • LOFAR-Release-4_4_306 protected
  • LOFAR-Release-4_4_304 protected
  • LOFAR-Release-4_4_303 protected
  • LOFAR-Release-4_4_302 protected
  • LOFAR-Release-4_4_301 protected
  • LOFAR-Release-4_4_300 protected
  • LOFAR-Release-4_4_299 protected
41 results

schedulingunitflow.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    conftest.py 1.90 KiB
    ###############################################################################
    # SKA South Africa (http://ska.ac.za/)                                        #
    # Author: cam@ska.ac.za                                                       #
    # Copyright @ 2018 SKA SA. All rights reserved.                               #
    #                                                                             #
    # THIS SOFTWARE MAY NOT BE COPIED OR DISTRIBUTED IN ANY FORM WITHOUT THE      #
    # WRITTEN PERMISSION OF SKA SA.                                               #
    ###############################################################################
    """
    A module defining a list of fixture functions that are shared across all the skabase
    tests.
    """
    import mock
    import pytest
    import importlib
    
    
    from tango.test_context import DeviceTestContext
    
    
    @pytest.fixture(scope="class")
    def tango_context(request):
        """Creates and returns a TANGO DeviceTestContext object.
    
        Parameters
        ----------
        request: _pytest.fixtures.SubRequest
            A request object gives access to the requesting test context. 
        """
        fq_test_class_name = request.cls.__module__
        fq_test_class_name_details = fq_test_class_name.split(".")
        package_name = fq_test_class_name_details[0]
        class_name = module_name = fq_test_class_name_details[1]
        module = importlib.import_module("{}.{}".format(package_name, module_name))
        klass = getattr(module, class_name)
    
        tango_context = DeviceTestContext(klass)
        tango_context.start()
        klass.get_name = mock.Mock(side_effect=tango_context.get_device_access)
    
        yield tango_context
        tango_context.stop()
    
    
    @pytest.fixture(scope="function")
    def initialize_device(tango_context):
        """Re-initializes the device.
    
        Parameters
        ----------
        tango_context: tango.test_context.DeviceTestContext
            Context to run a device without a database.
        """
        yield tango_context.device.Init()