tools/bdconfig/lib/google_hadoop/bdconfig_lib/config_commands_test.py
def testNormalOperation(self):
    """Test configure_hadoop values wire through to correct xml keys."""
    self._SetDefaultValidFlags()
    self._flag_values_copy.dry_run = False
    self._test_cmd.Run(None)

    conf = xml_configuration.Configuration.FromFile(self._mapred_site_filename)
    self.assertEqual(6, conf.GetNumProperties())
    self.assertEquals('foo-host:9101', conf.GetPropertyValue(
        'mapred.job.tracker'))
    self.assertEquals('foo opts', conf.GetPropertyValue(
        'mapred.child.java.opts'))
    self.assertEquals('1', conf.GetPropertyValue(
        'mapred.map.tasks'))
    self.assertEquals('2', conf.GetPropertyValue(
        'mapred.reduce.tasks'))
    self.assertEquals('3', conf.GetPropertyValue(
        'mapred.tasktracker.map.tasks.maximum'))
    self.assertEquals('4', conf.GetPropertyValue(
        'mapred.tasktracker.reduce.tasks.maximum'))

    conf = xml_configuration.Configuration.FromFile(self._core_site_filename)
    self.assertEqual(1, conf.GetNumProperties())
    self.assertEquals(FLAGS.test_tmpdir, conf.GetPropertyValue(
        'hadoop.tmp.dir'))

    with open(self._hadoop_env_filename, 'r') as f:
      self.assertEqual(2, len(f.readlines()))
Test configure_hadoop values wire through to correct xml keys.
Test configure_hadoop values wire through to correct xml keys.
Test configure_hadoop values wire through to correct xml keys .
def testNormalOperation(self):
    self._SetDefaultValidFlags()
    self._flag_values_copy.dry_run = False
    self._test_cmd.Run(None)
    conf = xml_configuration.Configuration.FromFile(self._mapred_site_filename)
    self.assertEqual(6, conf.GetNumProperties())
    self.assertEquals('foo-host:9101', conf.GetPropertyValue(
        'mapred.job.tracker'))
    self.assertEquals('foo opts', conf.GetPropertyValue(
        'mapred.child.java.opts'))
    self.assertEquals('1', conf.GetPropertyValue(
        'mapred.map.tasks'))
    self.assertEquals('2', conf.GetPropertyValue(
        'mapred.reduce.tasks'))
    self.assertEquals('3', conf.GetPropertyValue(
        'mapred.tasktracker.map.tasks.maximum'))
    self.assertEquals('4', conf.GetPropertyValue(
        'mapred.tasktracker.reduce.tasks.maximum'))
    conf = xml_configuration.Configuration.FromFile(self._core_site_filename)
    self.assertEqual(1, conf.GetNumProperties())
    self.assertEquals(FLAGS.test_tmpdir, conf.GetPropertyValue(
        'hadoop.tmp.dir'))
    with open(self._hadoop_env_filename, 'r') as f:
      self.assertEqual(2, len(f.readlines()))
def testNormalOperation ( self ) : self . _SetDefaultValidFlags ( ) self . _flag_values_copy . dry_run = False self . _test_cmd . Run ( None ) conf = xml_configuration . Configuration . FromFile ( self . _mapred_site_filename ) self . assertEqual ( 6 , conf . GetNumProperties ( ) ) self . assertEquals ( 'foo-host:9101' , conf . GetPropertyValue ( 'mapred.job.tracker' ) ) self . assertEquals ( 'foo opts' , conf . GetPropertyValue ( 'mapred.child.java.opts' ) ) self . assertEquals ( '1' , conf . GetPropertyValue ( 'mapred.map.tasks' ) ) self . assertEquals ( '2' , conf . GetPropertyValue ( 'mapred.reduce.tasks' ) ) self . assertEquals ( '3' , conf . GetPropertyValue ( 'mapred.tasktracker.map.tasks.maximum' ) ) self . assertEquals ( '4' , conf . GetPropertyValue ( 'mapred.tasktracker.reduce.tasks.maximum' ) ) conf = xml_configuration . Configuration . FromFile ( self . _core_site_filename ) self . assertEqual ( 1 , conf . GetNumProperties ( ) ) self . assertEquals ( FLAGS . test_tmpdir , conf . GetPropertyValue ( 'hadoop.tmp.dir' ) ) with open ( self . _hadoop_env_filename , 'r' ) as f : self . assertEqual ( 2 , len ( f . readlines ( ) ) )
Test configure_hadoop values wire through to correct xml keys.
Test configure_hadoop values wire through to correct xml keys .
"""Test configure_hadoop values wire through to correct xml keys."""
self