Exemplo n.º 1
0
Arquivo: quotes.py Projeto: mineo/lala
 def callback(quotes):
     max_quotes = get_int("max_quotes")
     if len(quotes) > max_quotes:
         msg(channel, "Too many results, please refine your search")
     elif len(quotes) == 0:
         msg(channel, "No matching quotes found")
     else:
         for quote in quotes:
             _send_quote_to_channel(channel, quote)
Exemplo n.º 2
0
 def test_default_doesnt_overwrite(self):
     config.set("not_overwritten_key", 1)
     self._set_default_options(not_overwritten_key=2)
     self.assertEquals(config.get_int("not_overwritten_key"), 1)
Exemplo n.º 3
0
 def test_converter_int_setandget(self):
     config.set("intkey", 2)
     self.assertTrue(isinstance(config.get_int("intkey"), int))
Exemplo n.º 4
0
 def test_set_default_options(self):
     self._set_default_options(stringkey="foo", defaultintkey="1")
     self.assertEqual(config.get("stringkey"), "foo")
     self.assertEqual(config.get_int("defaultintkey"), 1)