예제 #1
0
 def test__get_currently_parsable_command(self):
     data = {
         'commands': {
             'current-command': {
                 'done': False
             },
             'finished-command': {
                 'done': True
             }
         }
     }
     expected = data['commands']['current-command']
     result = utils.get_current_command(data)
     self.assertEqual(expected, result)
예제 #2
0
 def test__no_returnable_command_found__returns_none(self):
     data = {
         'commands': {
             'current-command': {
                 'done': True
             },
             'finished-command': {
                 'done': True
             }
         }
     }
     expected = None
     result = utils.get_current_command(data)
     self.assertEqual(expected, result)
예제 #3
0
 def test__get_currently_parsable_command(self):
     data = {
         'commands': {
             'current-command': {
                 'done': False
             },
             'finished-command': {
                 'done': True
             }
         }
     }
     expected = data['commands']['current-command']
     result = utils.get_current_command(data)
     self.assertEqual(expected, result)
예제 #4
0
 def test__no_returnable_command_found__returns_none(self):
     data = {
         'commands': {
             'current-command': {
                 'done': True
             },
             'finished-command': {
                 'done': True
             }
         }
     }
     expected = None
     result = utils.get_current_command(data)
     self.assertEqual(expected, result)
예제 #5
0
 def test__alternative_commands_can_be_handled(self):
     data = {
         'commands': {
             'my_command': {
                 'done': False,
                 'post': ['some command']
             },
             'alternative': {
                 'alias': 'my_command'
             }
         }
     }
     expected = data['commands']['my_command']
     result = utils.get_current_command(data)
     self.assertEqual(expected, result)
예제 #6
0
 def test__alternative_commands_can_be_handled(self):
     data = {
         'commands': {
             'my_command': {
                 'done': False,
                 'post': ['some command']
             },
             'alternative': {
                 'alias': 'my_command'
             }
         }
     }
     expected = data['commands']['my_command']
     result = utils.get_current_command(data)
     self.assertEqual(expected, result)