예제 #1
0
    def test_should_convert_dictionary_to_object(self):
        values = {'command_input': {'command': 'any_command',
                                    'arguments': ['any_arguments'],
                                    'stdin': 'any_stdin'},
                  'expected': True}

        actual = Execution.from_dictionary(values)

        self.assertEqual('any_command', actual.command_input.command)
        self.assertEqual(['any_arguments'], actual.command_input.arguments)
        self.assertEqual('any_stdin', actual.command_input.stdin)
        self.assertEqual(True, actual.expected)
예제 #2
0
파일: __init__.py 프로젝트: yadt/shtub
def deserialize_executions (filename):
    """
        loads the given json file and returns a list of executions.
    """
    executions = _load_json_file(filename)
    return list(map(lambda e: Execution.from_dictionary(e), executions))
예제 #3
0
def deserialize_executions(filename):
    """
        loads the given json file and returns a list of executions.
    """
    executions = _load_json_file(filename)
    return list(map(lambda e: Execution.from_dictionary(e), executions))