Esempio n. 1
0
    def test_host_dict(self):

        config_file = '%(cp)s/test_confighelper.json' % { 'cp': current_path }
        
        ch = ConfigHelper(config_file, TEST_HOST_NAME)

        host_dict = ch.get_host_conf('dict');
        self.assertTrue(host_dict == { 'name_one': 'value_one' })
Esempio n. 2
0
    def test_host_string(self):

        config_file = '%(cp)s/test_confighelper.json' % { 'cp': current_path }
        
        ch = ConfigHelper(config_file, TEST_HOST_NAME)

        host_str = ch.get_host_conf('string');
        self.assertEqual(host_str, 'test')
Esempio n. 3
0
    def test_host_list(self):

        config_file = '%(cp)s/test_confighelper.json' % { 'cp': current_path }
        
        ch = ConfigHelper(config_file, TEST_HOST_NAME)

        host_list = ch.get_host_conf('list');
        self.assertEqual(host_list, [ 1, 2, 3 ] )
Esempio n. 4
0
    def test_host_number(self):

        config_file = '%(cp)s/test_confighelper.json' % { 'cp': current_path }
        
        ch = ConfigHelper(config_file, TEST_HOST_NAME)

        host_num = ch.get_host_conf('number');
        self.assertEqual(host_num, 3)