コード例 #1
0
 def test_get_settings_should_return_none_if_default_is_off(self):
     # given: Following setting is saved
     reqargs = {'SectionBellStopper_DefaultOn': 'No'}
     user_settings.save_user_settings(reqargs)
     # when
     settings = get_stop_the_bell_settings_from_config()
     # then
     assert settings == None
コード例 #2
0
 def test_get_settings_should_return_none_if_default_is_off(self):
     # given: Following setting is saved
     reqargs = {'SectionBellFader_DefaultOn': 'No'}
     user_settings.save_user_settings(reqargs)
     # when
     fadeInSettings = get_fade_in_settings_from_config()
     # then
     assert fadeInSettings == None
コード例 #3
0
ファイル: radio.py プロジェクト: hawkpatrick/raspradio
def entrypoint_configure_settings():
    reqargs = request.args
    streams.http_configure_streams(reqargs)
    if 'update_settings' in reqargs:
        user_settings.save_user_settings(reqargs)
    config = user_settings.get_user_settings()
    return render_template(
        html_links[configure_settings] + ".html", 
        html_links=html_links,
        streams=streams.radio_streams[:],
        config=config)     
コード例 #4
0
 def test_get_settings_should_not_return_null_if_default_is_on(self):
     # given: Following setting is saved
     reqargs = {
         'SectionBellStopper_DefaultOn': 'Yes',
         'SectionBellStopper_DurationInMinutes': '2'
     }
     user_settings.save_user_settings(reqargs)
     # when
     stopTheBellSettings = get_stop_the_bell_settings_from_config()
     # then
     self.assertIsNotNone(stopTheBellSettings)
     assert stopTheBellSettings.turnOffAfterMinutes == 2
コード例 #5
0
 def test_get_settings_should_not_return_null_if_default_is_on(self):
     # given: Following setting is saved
     reqargs = {
         'SectionBellFader_DefaultOn': 'Yes',
         'SectionBellFader_TimespanInSeconds': '2'
     }
     user_settings.save_user_settings(reqargs)
     # when
     fadeInSettings = get_fade_in_settings_from_config()
     # then
     self.assertIsNotNone(fadeInSettings)
     assert fadeInSettings.durationInSeconds == 2