示例#1
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
示例#2
0
 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
示例#3
0
 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
示例#4
0
 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)
示例#5
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
示例#6
0
 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)