def test_an_alias_maps_correctly(self, import_string): alias, full_path = INTERFACE_ALIASES.items()[0] result = validate_data(self.project, {"project": self.project.id, "message": "foo", alias: {"foo": "bar"}}) import_string.assert_called_once_with(full_path) interface = import_string.return_value interface.assert_called_once_with(foo="bar") assert alias not in result assert full_path in result assert result[full_path] == interface.return_value.serialize.return_value
def test_an_alias_maps_correctly(self, import_string): alias, full_path = INTERFACE_ALIASES.items()[0] result = validate_data(self.project, { 'project': self.project.id, 'message': 'foo', alias: {'foo': 'bar'}, }) import_string.assert_called_once_with(full_path) interface = import_string.return_value interface.assert_called_once_with(foo='bar') assert alias not in result assert full_path in result assert result[full_path] == interface.return_value.serialize.return_value