twilio-labs / socless_python Goto Github PK
View Code? Open in Web Editor NEWPython library for the SOCless Automation Framework
License: Apache License 2.0
Python library for the SOCless Automation Framework
License: Apache License 2.0
When resolving a stringified number as a parameter, the template engine converts the stringified number into an actual number type. For example, given the context object
{
"signups": "100"
}
and parameter map
{
"attendees": "{{context.signups}}"
}
The returned resolved parameter object is a number type..
{
"attendees": 100
}
instead of a string
{
"attendees": "100"
}
The expectation is that resolving a stringified number will return a the original strigified number without casting it to a number type (i.e integer or float)
from socless.paramresolver import ParameterResolver
context = {"signups": "100"}
resolver = ParameterResolver(context)
params = {"attendees": "{{context.signups}}"}
expected = {"attendees": "100"}
# This should throw an assertion error
assert resolver.resolve_parameters(params) == expected, "Parameter Resolver not returning expected object"
Adding single quotes around the template string prevents the stringified number from being cast to a number type. As an example, the below yields the correct response (note the additional single-quotes)
{
"attendees": "'{{context.signups}}'"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.