'Test check_setting_float'

def test_check_setting_float(self):

    CFG = ConfigObj('config.ini', encoding='UTF-8')
    config.check_section(CFG, 'General')
    CFG['General']['fanart_background_opacity'] = 0.5
    CFG['General']['log_size'] = None
    self.assertEqual(config.check_setting_float(CFG, 'General', 'fanart_background_opacity', 0.4), 0.5)
    self.assertEqual(CFG['General']['fanart_background_opacity'], 0.5)
    self.assertEqual(config.check_setting_float(CFG, 'General', 'fanart_background_opacity', 0.7, 0.6, 1.0), 0.7)
    self.assertEqual(CFG['General']['fanart_background_opacity'], 0.7)
    self.assertEqual(config.check_setting_float(CFG, 'General', 'fanart_background_opacity', 0.7, 0.8, 1.0, False), 0.8)
    self.assertEqual(CFG['General']['fanart_background_opacity'], 0.8)
    self.assertEqual(config.check_setting_float(CFG, 'General', 'fanart_background_opacity', 0.3, 0.1, 0.4), 0.3)
    self.assertEqual(CFG['General']['fanart_background_opacity'], 0.3)
    self.assertEqual(config.check_setting_float(CFG, 'General', 'fanart_background_opacity', 0.1, 0.1, 0.2, False), 0.2)
    self.assertEqual(CFG['General']['fanart_background_opacity'], 0.2)
    self.assertEqual(config.check_setting_float(CFG, 'General', 'log_size', 10.0, silent=False), 10.0)
    self.assertEqual(CFG['General']['log_size'], 10.0)
    self.assertEqual(config.check_setting_float(CFG, 'Kodi', 'log_size', 2.5), 2.5)
    self.assertEqual(CFG['Kodi']['log_size'], 2.5)
    self.assertEqual(config.check_setting_float(CFG, 'General', 'fanart_background_opacity', 'ba', 'min', 'max'), 0.2)
    self.assertEqual(CFG['General']['fanart_background_opacity'], 0.2)
