Ejemplo n.º 1
0
    def testRUpdateEmpty(self):
        d = {}

        # Both empty.
        dictutils.rUpdate(d, {})
        self.assertDictEqual(d, {})

        # Original empty.
        dictutils.rUpdate(d, {"a": 1})
        self.assertDictEqual(d, {"a": 1})

        # Update empty.
        dictutils.rUpdate(d, {})
        self.assertDictEqual(d, {"a": 1})
Ejemplo n.º 2
0
  def testRUpdateEmpty(self):
    d = {}

    # Both empty.
    dictutils.rUpdate(d, {})
    self.assertDictEqual(d, {})

    # Original empty.
    dictutils.rUpdate(d, {"a": 1})
    self.assertDictEqual(d, {"a": 1})

    # Update empty.
    dictutils.rUpdate(d, {})
    self.assertDictEqual(d, {"a": 1})
Ejemplo n.º 3
0
 def testRUpdateBasic(self):
     d = {"a": {"b": 2, "e": 4}, "c": {"d": 3}}
     dictutils.rUpdate(d, {"a": {"b": 5}})
     self.assertDictEqual(d, {"a": {"b": 5, "e": 4}, "c": {"d": 3}})
Ejemplo n.º 4
0
 def testRUpdateBasic(self):
   d = {"a": {"b": 2, "e": 4},
        "c": {"d": 3}}
   dictutils.rUpdate(d, {"a": {"b": 5}})
   self.assertDictEqual(d, {"a": {"b": 5, "e": 4},
                            "c": {"d": 3}})
def updateConfigFromSubConfig(config):
  # Newer method just updates from sub-experiment
  # _config is the configuration provided by the sub-experiment
  global _config
  rUpdate(config, _config)
  _config = dict()
Ejemplo n.º 6
0
def updateConfigFromSubConfig(config):
  # _config is the configuration provided by the sub-experiment
  global _config
  rUpdate(config, _config)
  _config = dict()
Ejemplo n.º 7
0
def updateConfigFromSubConfig(config):
    # _config is the configuration provided by the sub-experiment
    global _config
    rUpdate(config, _config)
    _config = dict()