Changeset 686:ffac68f1c5ce for nagslang


Ignore:
Timestamp:
Sep 11, 2013, 2:35:53 PM (7 years ago)
Author:
Neil Muller <drnlmuller@…>
Branch:
default
Message:

Update action tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/tests/test_environment.py

    r32 r686  
    102102        self.state.setdefault(name, [])
    103103
    104         def action_func(protagonist, target):
    105             self.state[name].append((protagonist, target))
     104        def action_func(protagonist):
     105            self.state[name].append(protagonist)
    106106            return len(self.state[name])
    107107
     
    122122        self.assertTrue(action.check(None))
    123123        self.assert_state(action=[])
    124         self.assertEqual(1, action.perform('p', 't'))
    125         self.assert_state(action=[('p', 't')])
    126         self.assertEqual(2, action.perform('p2', 't2'))
    127         self.assert_state(action=[('p', 't'), ('p2', 't2')])
     124        self.assertEqual(1, action.perform('p'))
     125        self.assert_state(action=['p'])
     126        self.assertEqual(2, action.perform('p2'))
     127        self.assert_state(action=['p', 'p2'])
    128128
    129129    def test_conditional_action(self):
     
    135135        self.assertFalse(no_action.check(None))
    136136        self.assert_state(yes_action=[], no_action=[])
    137         self.assertEqual(1, yes_action.perform('p', 't'))
    138         self.assert_state(yes_action=[('p', 't')], no_action=[])
     137        self.assertEqual(1, yes_action.perform('p'))
     138        self.assert_state(yes_action=['p'], no_action=[])
    139139
    140140    def test_perform_bad_action(self):
     
    143143        self.assertFalse(action.check(None))
    144144        self.assert_state(action=[])
    145         self.assertRaises(ValueError, action.perform, 'p', 't')
     145        self.assertRaises(ValueError, action.perform, 'p')
    146146
    147147    def test_interactible_no_actions(self):
Note: See TracChangeset for help on using the changeset viewer.