def test_ability_to_specify_primary_scope(self):

        preferences = ScopedPreferences(
            scopes=[Preferences(name="a"), Preferences(name="b"), Preferences(name="c")], primary_scope_name="b"
        )

        # This should set the prefrrence in the primary scope.
        preferences.set("acme.foo", "bar")

        # Look it up specifically in the primary scope.
        self.assertEqual("bar", preferences.get("b/acme.foo"))

        return
Exemple #2
0
    def test_ability_to_specify_primary_scope(self):

        preferences = ScopedPreferences(
            scopes=[
                Preferences(name="a"),
                Preferences(name="b"),
                Preferences(name="c"),
            ],
            primary_scope_name="b",
        )

        # This should set the prefrrence in the primary scope.
        preferences.set("acme.foo", "bar")

        # Look it up specifically in the primary scope.
        self.assertEqual("bar", preferences.get("b/acme.foo"))
    def test_ability_to_specify_primary_scope(self):

        preferences = ScopedPreferences(scopes=[
            Preferences(name='a'),
            Preferences(name='b'),
            Preferences(name='c')
        ],
                                        primary_scope_name='b')

        # This should set the prefrrence in the primary scope.
        preferences.set('acme.foo', 'bar')

        # Look it up specifically in the primary scope.
        self.assertEqual('bar', preferences.get('b/acme.foo'))

        return
    def test_ability_to_specify_primary_scope(self):

        preferences = ScopedPreferences(
            scopes = [
                Preferences(name='a'),
                Preferences(name='b'),
                Preferences(name='c')
            ],

            primary_scope_name = 'b'
        )

        # This should set the prefrrence in the primary scope.
        preferences.set('acme.foo', 'bar')

        # Look it up specifically in the primary scope.
        self.assertEqual('bar', preferences.get('b/acme.foo'))

        return
from infobiotics.pmodelchecker.pmodelchecker_preferences import PREFERENCES_PATH as PMODELCHECKER_PREFERENCES_PATH
from infobiotics.pmodelchecker.prism.prism_preferences import PREFERENCES_PATH as PRISM_PREFERENCES_PATH
from infobiotics.pmodelchecker.mc2.mc2_preferences import PREFERENCES_PATH as MC2_PREFERENCES_PATH
from infobiotics.pmodelchecker.mc2.mc2_preferences import MC2_MCSS_PREFERENCES_PATH
from infobiotics.poptimizer.poptimizer_preferences import PREFERENCES_PATH as POPTIMIZER_PREFERENCES_PATH

DEFAULT_MCSS_EXECUTABLE = 'default/'+MCSS_PREFERENCES_PATH+'.executable'
DEFAULT_MCSSCMAES_EXECUTABLE = 'default/'+MCSSCMAES_PREFERENCES_PATH+'.executable'
DEFAULT_PMODELCHECKER_EXECUTABLE = 'default/'+PMODELCHECKER_PREFERENCES_PATH+'.executable'
DEFAULT_PRISM_EXECUTABLE = 'default/'+PRISM_PREFERENCES_PATH+'.executable'
DEFAULT_MC2_EXECUTABLE = 'default/'+MC2_PREFERENCES_PATH+'.executable'
DEFAULT_MC2_MCSS_EXECUTABLE = 'default/'+MC2_MCSS_PREFERENCES_PATH+'.executable'
DEFAULT_POPTIMIZER_EXECUTABLE = 'default/'+POPTIMIZER_PREFERENCES_PATH+'.executable'

if sys.platform.startswith('win'):
    preferences.set(DEFAULT_MCSS_EXECUTABLE, 'mcss.exe'),
    preferences.set(DEFAULT_MCSSCMAES_EXECUTABLE, 'mcss-cmaes.exe'),
    preferences.set(DEFAULT_PMODELCHECKER_EXECUTABLE, 'pmodelchecker.exe'),
    preferences.set(DEFAULT_PRISM_EXECUTABLE, 'pmodelchecker.exe'),
    preferences.set(DEFAULT_MC2_EXECUTABLE, 'pmodelchecker.exe'),
    preferences.set(DEFAULT_MC2_MCSS_EXECUTABLE, 'mcss.exe'),
    preferences.set(DEFAULT_POPTIMIZER_EXECUTABLE, 'poptimizer.exe'),
else:
    # RelativeFile traits use Which module to find files on the PATH so we don't
    # need to hard code paths like this: 
    #     preferences.set(DEFAULT_MCSS_EXECUTABLE, '/usr/bin/mcss'),
    preferences.set(DEFAULT_MCSS_EXECUTABLE, 'mcss'),
    preferences.set(DEFAULT_MCSSCMAES_EXECUTABLE, 'mcss-cmaes'),
    preferences.set(DEFAULT_PMODELCHECKER_EXECUTABLE, 'pmodelchecker'),
    preferences.set(DEFAULT_PRISM_EXECUTABLE, 'pmodelchecker'),
    preferences.set(DEFAULT_MC2_EXECUTABLE, 'pmodelchecker'),