コード例 #1
0
    def testListOutOfRangeSet(self):
        """Tries to override out-of-range value in list."""

        test_config = mock_config.get_config()
        with self.assertRaises(config_flags.UnsupportedOperationError):
            config_flags.SetValue('dict.list[2][1]', test_config, -1)
コード例 #2
0
    def testReadingSettingExistingKeyInDict(self):
        """Tests setting non existing key from dict inside config."""

        test_config = mock_config.get_config()
        with self.assertRaises(KeyError):
            config_flags.SetValue('dict.not_existing_key.key', test_config, 1)
コード例 #3
0
    def testEmptyKey(self):
        """Tests calling an empty key update."""

        test_config = mock_config.get_config()
        with self.assertRaises(ValueError):
            config_flags.SetValue('', test_config, None)
コード例 #4
0
    def testReadingNonExistingKey(self):
        """Tests reading non existing key from config."""

        test_config = mock_config.get_config()
        with self.assertRaises(config_flags.UnsupportedOperationError):
            config_flags.SetValue('dict.not_existing_key', test_config, 1)