示例#1
0
    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())
示例#2
0
def actions():
    Echo = Action.new('Echo', lambda x: x)

    assert Echo.NAME == 'echo'
    return Action.plugins()
示例#3
0
def actions():
    Echo = Action.new('Echo', lambda x: x)

    assert Echo.NAME == 'echo'
    return Action.plugins()