예제 #1
0
 def test_getCommands_cache(self):
     """
     getCommands should cache the results
     """
     s = ShellProtocol()
     c = s.getCommands()
     def f():
         pass
     s.cmd_something = f
     c2 = s.getCommands()
     self.assertEqual(c, c2)
예제 #2
0
 def test_getCommands(self):
     """
     Should return a dictionary where the key is the command name
     and the value is the function called to run the command.
     """
     s = ShellProtocol()
     def f():
         pass
     s.cmd_something = f
     c = s.getCommands()
     self.assertEqual(c['something'], f)