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)
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))
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))