Пример #1
0
    def test_setting_partial_user_preferences_with_existing(self):
        """Test case for setting partial user preferences with existing

        :param self: self
        """
        update = self._user_update
        PreferencesService.update_user_prefs(self, update, {})
        self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
Пример #2
0
    def test_setting_partial_user_preferences_with_existing(self):
        """Test case for setting partial user preferences with existing

        :param self: self
        """
        update = self._user_update
        PreferencesService.update_user_prefs(self, update, {})
        self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
Пример #3
0
    def test_setting_partial_session_preferences_with_empty_existing(self):
        update = self._session_update
        existing_session_settings = {"1234": {}}

        PreferencesService.update_session_prefs(self, update,
                                                existing_session_settings,
                                                '1234')
        self.assertListEqual(
            update["session_preferences"]["1234"]["scratchpad:items"], [123])
Пример #4
0
    def test_setting_partial_session_preferences_with_empty_existing(self):
        """Test case for setting partial session perferences with empty existing

        :param self: self
        """
        update = self._session_update
        existing_session_settings = {"1234": {}}

        PreferencesService.update_session_prefs(self, update, existing_session_settings, '1234')
        self.assertListEqual(update["session_preferences"]["1234"]["scratchpad:items"], [123])
Пример #5
0
    def test_setting_partial_session_preferences_with_empty_existing(self):
        """Test case for setting partial session perferences with empty existing

        :param self: self
        """
        update = self._session_update
        existing_session_settings = {"1234": {}}

        PreferencesService.update_session_prefs(self, update, existing_session_settings, '1234')
        self.assertListEqual(update["session_preferences"]["1234"]["scratchpad:items"], [123])
Пример #6
0
    def test_setting_partial_session_preferences_with_existing(self):
        existing_session_settings = {
            "desk:items": [],
            "stage:items": [],
            "pinned:items": ['a', 'b', 'c'],
            "scratchpad:items": []
        }

        update = self._session_update
        PreferencesService.partial_update(self, update, existing_session_settings,
                                          self._default_session_settings, "session_preferences")
        self.assertListEqual(update["session_preferences"]["scratchpad:items"], [123])
Пример #7
0
    def test_setting_partial_session_preferences_with_existing(self):
        """Test case for setting partial session perferences with exiting

        :param self: self
        """
        existing_session_settings = {"1234":
                                     {
                                         "desk:items": [],
                                         "stage:items": [],
                                         "pinned:items": ['a', 'b', 'c'],
                                         "scratchpad:items": []
                                     }
                                     }

        update = self._session_update
        PreferencesService.update_session_prefs(self, update, existing_session_settings, '1234')
        self.assertListEqual(update["session_preferences"]["1234"]["scratchpad:items"], [123])
Пример #8
0
    def test_setting_partial_user_preferences_with_empty_existing(self):
        update = self._user_update
        existing_user_settings = {
            "archive:view": {
                "default": "mgrid",
                "label": "Users archive view format",
                "type": "string",
                "category": "archive",
                "allowed": ["mgrid", "compact"],
                "view": "mgrid"
            }
        }

        PreferencesService.update_user_prefs(self, update,
                                             existing_user_settings)
        self.assertEqual(update["user_preferences"]["archive:view"]["label"],
                         "Testing user preferences")
Пример #9
0
    def test_setting_partial_session_preferences_with_existing(self):
        """Test case for setting partial session perferences with exiting

        :param self: self
        """
        existing_session_settings = {"1234":
                                     {
                                         "desk:items": [],
                                         "stage:items": [],
                                         "pinned:items": ['a', 'b', 'c'],
                                         "scratchpad:items": []
                                     }
                                     }

        update = self._session_update
        PreferencesService.update_session_prefs(self, update, existing_session_settings, '1234')
        self.assertListEqual(update["session_preferences"]["1234"]["scratchpad:items"], [123])
Пример #10
0
    def test_setting_partial_user_preferences_with_empty_existing(self):
        update = self._user_update
        existing_user_settings = {
            "archive:view": {
                "default": "mgrid",
                "label": "Users archive view format",
                "type": "string",
                "category": "archive",
                "allowed": [
                    "mgrid",
                    "compact"
                ],
                "view": "mgrid"
            }
        }

        PreferencesService.update_user_prefs(self, update, existing_user_settings)
        self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
Пример #11
0
    def test_setting_partial_session_preferences_with_empty_existing(self):
        update = self._session_update
        existing_session_settings = {"1234": {}}

        PreferencesService.update_session_prefs(self, update, existing_session_settings, '1234')
        self.assertListEqual(update["session_preferences"]["1234"]["scratchpad:items"], [123])
Пример #12
0
 def test_setting_partial_user_preferences_with_existing(self):
     update = self._user_update
     PreferencesService.partial_update(self, update, {}, self._default_user_settings, "user_preferences")
     self.assertEqual(update["user_preferences"]["archive:view"]["label"], "Testing user preferences")
Пример #13
0
 def test_setting_partial_session_preferences_with_empty_existing(self):
     update = self._session_update
     PreferencesService.partial_update(self, update, {}, self._default_session_settings, "session_preferences")
     self.assertListEqual(update["session_preferences"]["scratchpad:items"], [123])