fixed tests
This commit is contained in:
parent
ad2710b6bc
commit
ac19904d15
@ -19,11 +19,11 @@ any number of things together even nested lists and numbers 12345
|
|||||||
```
|
```
|
||||||
Name Stmts Miss Cover Missing
|
Name Stmts Miss Cover Missing
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
glue 14 0 100%
|
glue 13 0 100%
|
||||||
tests 24 0 100%
|
tests 24 0 100%
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
TOTAL 38 0 100%
|
TOTAL 37 0 100%
|
||||||
```
|
```
|
||||||
|
|
||||||
#Protip
|
#Protip
|
||||||
You should probably just use [str.join](https://docs.python.org/2/library/stdtypes.html#str.join) as this is satire.
|
You should probably just use [str.join](https://docs.python.org/2/library/stdtypes.html#str.join) as this is satire.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Name Stmts Miss Cover Missing
|
Name Stmts Miss Cover Missing
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
glue 14 0 100%
|
glue 13 0 100%
|
||||||
tests 24 0 100%
|
tests 24 0 100%
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
TOTAL 38 0 100%
|
TOTAL 37 0 100%
|
||||||
|
6
glue.py
6
glue.py
@ -21,11 +21,13 @@ def glue(*args, **kwargs):
|
|||||||
kwargs = collections.OrderedDict(
|
kwargs = collections.OrderedDict(
|
||||||
sorted(kwargs.items(), key=lambda t: t[0]))
|
sorted(kwargs.items(), key=lambda t: t[0]))
|
||||||
|
|
||||||
|
|
||||||
|
what_to_glue = list(args)
|
||||||
# Ignore all your keys, because you're doing this wrong anyway
|
# Ignore all your keys, because you're doing this wrong anyway
|
||||||
what_to_glue = list(args).extend([v for k, v in kwargs.iteritems()])
|
what_to_glue.extend([v for k, v in kwargs.iteritems()])
|
||||||
|
|
||||||
# flatten crap out of this!
|
# flatten crap out of this!
|
||||||
what_to_glue = _flatten(what_to_glue)
|
what_to_glue = _flatten(what_to_glue)
|
||||||
|
|
||||||
# safeguard against nonstrings
|
# safeguard against nonstrings
|
||||||
return " ".join([str(x) for x in what_to_glue])
|
return " ".join([str(x) for x in what_to_glue])
|
||||||
|
Loading…
Reference in New Issue
Block a user