def _test_environ(self): host = Host(config_file, 'clutch') environ = host.environ() self.assertEqual(environ['ld_library_path'], '/usr/local/lib') # no key provided self.assertEqual(host.environ('ld_library_path'), '/usr/local/lib') # key provided
def _test_missing_key(self): host=Host(config_file, 'clutch') try: self.assertEqual(host.environ('imaginary_key'), '/usr/local/lib') # key provided self.fail() except ConfigParser.NoOptionError: pass
def _test_missing_key(self): host = Host(config_file, 'clutch') try: self.assertEqual(host.environ('imaginary_key'), '/usr/local/lib') # key provided self.fail() except ConfigParser.NoOptionError: pass
def test_empty_environ(self): host=Host(config_file, 'imaginary_host') self.assertEqual(str(host), 'imaginary_host') env=host.environ() self.assertEqual(type(env), type({})) self.assertEqual(len(env), 0)
def _test_environ(self): host=Host(config_file, 'clutch') environ=host.environ() self.assertEqual(environ['ld_library_path'], '/usr/local/lib') # no key provided self.assertEqual(host.environ('ld_library_path'), '/usr/local/lib') # key provided
def test_empty_environ(self): host = Host(config_file, 'imaginary_host') self.assertEqual(str(host), 'imaginary_host') env = host.environ() self.assertEqual(type(env), type({})) self.assertEqual(len(env), 0)