Beispiel #1
0
   def test_long_values_are_pretty_printed(self):
       self.settings.FRONTEND = (u'mopidy.frontends.mpd.MpdFrontend',
           u'mopidy.frontends.lastfm.LastfmFrontend')
       result = format_settings_list(self.settings)
       self.assert_("""FRONTEND: 
 (u'mopidy.frontends.mpd.MpdFrontend',
  u'mopidy.frontends.lastfm.LastfmFrontend')""" in result, result)
Beispiel #2
0
   def test_long_values_are_pretty_printed(self):
       self.settings.FRONTEND = (u'mopidy.frontends.mpd.MpdFrontend',
                                 u'mopidy.frontends.lastfm.LastfmFrontend')
       result = setting_utils.format_settings_list(self.settings)
       self.assert_(
           """FRONTEND: 
 (u'mopidy.frontends.mpd.MpdFrontend',
  u'mopidy.frontends.lastfm.LastfmFrontend')""" in result, result)
Beispiel #3
0
 def test_long_values_are_pretty_printed(self):
     self.settings.FRONTEND = (
         u'mopidy.frontends.mpd.MpdFrontend',
         u'mopidy.frontends.lastfm.LastfmFrontend')
     result = setting_utils.format_settings_list(self.settings)
     self.assertIn(
         "FRONTEND: \n"
         "  (u'mopidy.frontends.mpd.MpdFrontend',\n"
         "   u'mopidy.frontends.lastfm.LastfmFrontend')",
         result)
Beispiel #4
0
 def test_repr_of_an_int_value(self):
     self.settings.TEST = 123
     result = format_settings_list(self.settings)
     self.assert_("TEST: 123" in result, result)
Beispiel #5
0
 def test_repr_of_a_string_value(self):
     self.settings.TEST = u'test'
     result = format_settings_list(self.settings)
     self.assert_("TEST: u'test'" in result, result)
Beispiel #6
0
 def test_contains_the_setting_name(self):
     self.settings.TEST = u'test'
     result = format_settings_list(self.settings)
     self.assert_('TEST:' in result, result)
Beispiel #7
0
 def test_short_values_are_not_pretty_printed(self):
     self.settings.FRONTEND = ('mopidy.frontends.mpd.MpdFrontend',)
     result = setting_utils.format_settings_list(self.settings)
     self.assertIn(
         "FRONTEND: (u'mopidy.frontends.mpd.MpdFrontend',)", result)
Beispiel #8
0
 def test_repr_of_a_string_value(self):
     self.settings.TEST = u'test'
     result = format_settings_list(self.settings)
     self.assert_("TEST: u'test'" in result, result)
Beispiel #9
0
 def test_short_values_are_not_pretty_printed(self):
     self.settings.FRONTEND = (u'mopidy.frontends.mpd.MpdFrontend',)
     result = format_settings_list(self.settings)
     self.assert_("FRONTEND: (u'mopidy.frontends.mpd.MpdFrontend',)" in result,
         result)
Beispiel #10
0
 def test_repr_of_an_int_value(self):
     self.settings.TEST = 123
     result = setting_utils.format_settings_list(self.settings)
     self.assertIn("TEST: 123", result, result)
Beispiel #11
0
 def test_repr_of_a_string_value(self):
     self.settings.TEST = 'test'
     result = setting_utils.format_settings_list(self.settings)
     self.assertIn("TEST: u'test'", result, result)
Beispiel #12
0
 def test_contains_the_setting_name(self):
     self.settings.TEST = 'test'
     result = setting_utils.format_settings_list(self.settings)
     self.assertIn('TEST:', result, result)
Beispiel #13
0
 def test_passwords_are_masked(self):
     self.settings.TEST_PASSWORD = u'secret'
     result = format_settings_list(self.settings)
     self.assert_("TEST_PASSWORD: u'secret'" not in result, result)
     self.assert_("TEST_PASSWORD: u'********'" in result, result)
Beispiel #14
0
 def test_repr_of_a_tuple_value(self):
     self.settings.TEST = (123, u'abc')
     result = format_settings_list(self.settings)
     self.assert_("TEST: (123, u'abc')" in result, result)
Beispiel #15
0
 def test_repr_of_an_int_value(self):
     self.settings.TEST = 123
     result = format_settings_list(self.settings)
     self.assert_("TEST: 123" in result, result)
Beispiel #16
0
 def test_repr_of_a_tuple_value(self):
     self.settings.TEST = (123, u'abc')
     result = format_settings_list(self.settings)
     self.assert_("TEST: (123, u'abc')" in result, result)
Beispiel #17
0
 def test_passwords_are_masked(self):
     self.settings.TEST_PASSWORD = u'secret'
     result = format_settings_list(self.settings)
     self.assert_("TEST_PASSWORD: u'secret'" not in result, result)
     self.assert_("TEST_PASSWORD: u'********'" in result, result)
Beispiel #18
0
 def test_repr_of_a_tuple_value(self):
     self.settings.TEST = (123, 'abc')
     result = setting_utils.format_settings_list(self.settings)
     self.assertIn("TEST: (123, u'abc')", result, result)
Beispiel #19
0
 def test_passwords_are_masked(self):
     self.settings.TEST_PASSWORD = '******'
     result = setting_utils.format_settings_list(self.settings)
     self.assertNotIn("TEST_PASSWORD: u'secret'", result, result)
     self.assertIn("TEST_PASSWORD: u'********'", result, result)
Beispiel #20
0
 def test_contains_the_setting_name(self):
     self.settings.TEST = u'test'
     result = format_settings_list(self.settings)
     self.assert_('TEST:' in result, result)