tools/bdconfig/lib/google_hadoop/bdconfig_lib/config_commands_test.py
def testHdfsFallbackToNamenodeRpcAddressFailure(self):
    """With hdfs, absence of fs.default.name fetches rpc-address and fails."""
    self._SetDefaultValidFlags()
    self._flag_values_copy.dry_run = False

    self._flag_values_copy.default_fs = 'hdfs'

    conf = xml_configuration.Configuration.FromFile(self._hdfs_site_filename)
    conf.Update({'dfs.namenode.rpc-address': 'badscheme://localhost:8020/'}, {})
    conf.WriteToFile(self._hdfs_site_filename)
    self.assertRaises(flags.IllegalFlagValue, self._test_cmd.Run, None)
    conf.Update({'dfs.namenode.rpc-address': 'hdfs://localhost:8020'}, {})
    conf.WriteToFile(self._hdfs_site_filename)
    self.assertRaises(flags.IllegalFlagValue, self._test_cmd.Run, None)
With hdfs, absence of fs.default.name fetches rpc-address and fails.
With hdfs, absence of fs.default.name fetches rpc-address and fails.
With hdfs absence of fs . default . name fetches rpc - address and fails .
def testHdfsFallbackToNamenodeRpcAddressFailure(self):
    self._SetDefaultValidFlags()
    self._flag_values_copy.dry_run = False
    self._flag_values_copy.default_fs = 'hdfs'
    conf = xml_configuration.Configuration.FromFile(self._hdfs_site_filename)
    conf.Update({'dfs.namenode.rpc-address': 'badscheme://localhost:8020/'}, {})
    conf.WriteToFile(self._hdfs_site_filename)
    self.assertRaises(flags.IllegalFlagValue, self._test_cmd.Run, None)
    conf.Update({'dfs.namenode.rpc-address': 'hdfs://localhost:8020'}, {})
    conf.WriteToFile(self._hdfs_site_filename)
    self.assertRaises(flags.IllegalFlagValue, self._test_cmd.Run, None)
def testHdfsFallbackToNamenodeRpcAddressFailure ( self ) : self . _SetDefaultValidFlags ( ) self . _flag_values_copy . dry_run = False self . _flag_values_copy . default_fs = 'hdfs' conf = xml_configuration . Configuration . FromFile ( self . _hdfs_site_filename ) conf . Update ( { 'dfs.namenode.rpc-address' : 'badscheme://localhost:8020/' } , { } ) conf . WriteToFile ( self . _hdfs_site_filename ) self . assertRaises ( flags . IllegalFlagValue , self . _test_cmd . Run , None ) conf . Update ( { 'dfs.namenode.rpc-address' : 'hdfs://localhost:8020' } , { } ) conf . WriteToFile ( self . _hdfs_site_filename ) self . assertRaises ( flags . IllegalFlagValue , self . _test_cmd . Run , None )
With hdfs, absence of fs.default.name fetches rpc-address and fails.
With hdfs absence of fs . default . name fetches rpc - address and fails .
"""With hdfs, absence of fs.default.name fetches rpc-address and fails."""
self