gabbi
gabbi copied to clipboard
need a way to inject a random name into things
One way to do this would be to have another replacement magic string, such as $UUID which gets a uuid.
However would this be the same uuid throughout all replacements on the current request, or a different one with each replacement. If the latter, how do we refer to the name again (for example in uri and in data)? Presumably in those cases the test writer should just make something up?
Gonna wait for a pressing need on this one.
One way to do this is to use $ENVIRON
, loaded with info from a fixture.
Another related use case...
I'm using this workaround with $ENVIRON and the fixture writing stuff out to my env for the moment, but I'm still running into some non-ideal moments. In some cases I want to pass in a token value with the current time (we've got a "user-friendly" start_at token which expects a formatted date-time string), so current_time winds up being a misnomer with this workaround.
Dare we consider shell expansions?