tools/bdconfig/lib/google_hadoop/bdconfig_lib/config_commands_test.py
def testDryRun(self):
    """Test --dry_run prevents modifications from being committed."""
    if not self._test_cmd:
      return
    self._SetDefaultValidFlags()
    self._flag_values_copy.dry_run = True
    self._test_cmd.Run(None)

    # Nothing added.
    conf = xml_configuration.Configuration.FromFile(self._core_site_filename)
    self.assertEqual(0, conf.GetNumProperties())
    conf = xml_configuration.Configuration.FromFile(self._mapred_site_filename)
    self.assertEqual(0, conf.GetNumProperties())
    with open(self._hadoop_env_filename, 'r') as f:
      self.assertEqual(1, len(f.readlines()))
Test --dry_run prevents modifications from being committed.
-dry_run prevents modifications from being committed.
- dry_run prevents modifications from being committed .
def testDryRun(self):
    if not self._test_cmd:
      return
    self._SetDefaultValidFlags()
    self._flag_values_copy.dry_run = True
    self._test_cmd.Run(None)
    conf = xml_configuration.Configuration.FromFile(self._core_site_filename)
    self.assertEqual(0, conf.GetNumProperties())
    conf = xml_configuration.Configuration.FromFile(self._mapred_site_filename)
    self.assertEqual(0, conf.GetNumProperties())
    with open(self._hadoop_env_filename, 'r') as f:
      self.assertEqual(1, len(f.readlines()))
def testDryRun ( self ) : if not self . _test_cmd : return self . _SetDefaultValidFlags ( ) self . _flag_values_copy . dry_run = True self . _test_cmd . Run ( None ) conf = xml_configuration . Configuration . FromFile ( self . _core_site_filename ) self . assertEqual ( 0 , conf . GetNumProperties ( ) ) conf = xml_configuration . Configuration . FromFile ( self . _mapred_site_filename ) self . assertEqual ( 0 , conf . GetNumProperties ( ) ) with open ( self . _hadoop_env_filename , 'r' ) as f : self . assertEqual ( 1 , len ( f . readlines ( ) ) )
Test --dry_run prevents modifications from being committed.
Test -- dry_run prevents modifications from being committed .
"""Test --dry_run prevents modifications from being committed.""" # Nothing added.
self