aws-cloudformation-templates icon indicating copy to clipboard operation
aws-cloudformation-templates copied to clipboard

StringFunctions example clearly incapable of converting to anything but lowercase.

Open miiichael opened this issue 1 year ago • 1 comments

I'll keep it brief. Here you invoke operation.lower(), which presumably you wouldn't want for the Upper, Capitalize, Title, and SwapCase use cases.

(Never mind that all this mucking about with macros just to get case conversion shouldn't even be necessary in the first place...)

miiichael avatar Aug 22 '24 03:08 miiichael

Due to inactivity this issue will be closed in 7 days

github-actions[bot] avatar Oct 21 '24 19:10 github-actions[bot]

Ugh.

miiichael avatar Oct 30 '24 01:10 miiichael

Can you include a test case that demonstrates the problem? Sorry for not putting any attention on this. Are you sure the referenced code isn't just lowering the name of the operation?

ericzbeard avatar Oct 30 '24 22:10 ericzbeard

Ohhh nooo.

Right, I'm an idiot. Closest to a retort I can come back with is "A comment or two wouldn't kill you". 😅

Annnnyway, in case anyone else needs convincing, a test case:

#!/bin/env python3

import handler

for operation in ["Upper", "Lower", "Capitalize", "Title", "SwapCase"]:
    event = {
        "requestId": "whatever",
        "params": {
            "Operation": operation,
            "InputString": "hElLo wOrLd",
        }
    }
    response = handler.handler(event, None)

    print(f"{operation}:\n\t {event=} {response=}")

miiichael avatar Oct 31 '24 02:10 miiichael