def test_normalize_asg_success(): default = "PT15M" assert normalize_asg_success(10) == ["10", default] assert normalize_asg_success("10") == ["10", default] assert normalize_asg_success("1 within 4h5s") == ["1", "PT4H5S"] assert normalize_asg_success("4 within 30m") == ["4", "PT30M"] assert normalize_asg_success("1 within 4h0m5s") == ["1", "PT4H0M5S"] assert normalize_asg_success("-1 within 5s") == ["-1", "PT5S"] # i just don't care about this with pytest.raises(click.UsageError): # no within keyword normalize_asg_success("1 in 5m") with pytest.raises(click.UsageError): # unparseable duration normalize_asg_success("1 within 5y") with pytest.raises(click.UsageError): # duration in wrong order normalize_asg_success("1 within 5s4h")