def test_creation_from_new(self): action = Action.new('shuffle', lambda cls, item: random.shuffle(item) ) self.assertEqual(action.__name__, 'Shuffle') self.assertEqual(action.NAME, 'shuffle') self.assertIn('shuffle', Action.plugins())
def actions(): Echo = Action.new('Echo', lambda x: x) assert Echo.NAME == 'echo' return Action.plugins()