コード例 #1
0
 def test_configparser_config_https(self):
     config = configparser.ConfigParser()
     config['general'] = {
         'base_port': 443,
     }
     protocol = get_protocol(config)
     self.assertEqual(protocol, 'https')
コード例 #2
0
 def test_dict_config_https(self):
     config = {
         'general': {
             'base_port': 443,
         },
     }
     protocol = get_protocol(config)
     self.assertEqual(protocol, 'https')
コード例 #3
0
def get_force_ssl(value, useConfigParser):
    config = {}
    if useConfigParser:
        config = configparser.ConfigParser()
    config['general'] = {
        'base_port': 80,
        'force_ssl': value,
    }
    return get_protocol(config)
コード例 #4
0
 def test_configparser_config_empty_http(self):
     config = configparser.ConfigParser()
     config['general'] = {}
     protocol = get_protocol(config)
     self.assertEqual(protocol, 'http')
コード例 #5
0
 def test_dict_config_empty_http(self):
     config = {'general': {}}
     protocol = get_protocol(config)
     self.assertEqual(protocol, 'http')