fixed tests

This commit is contained in:
Tyrel Souza 2014-10-30 14:50:07 -04:00
parent ad2710b6bc
commit ac19904d15
3 changed files with 9 additions and 7 deletions

View File

@ -19,11 +19,11 @@ any number of things together even nested lists and numbers 12345
```
Name Stmts Miss Cover Missing
-------------------------------------
glue 14 0 100%
glue 13 0 100%
tests 24 0 100%
-------------------------------------
TOTAL 38 0 100%
TOTAL 37 0 100%
```
#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.

View File

@ -1,6 +1,6 @@
Name Stmts Miss Cover Missing
-------------------------------------
glue 14 0 100%
glue 13 0 100%
tests 24 0 100%
-------------------------------------
TOTAL 38 0 100%
TOTAL 37 0 100%

View File

@ -21,11 +21,13 @@ def glue(*args, **kwargs):
kwargs = collections.OrderedDict(
sorted(kwargs.items(), key=lambda t: t[0]))
what_to_glue = list(args)
# 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!
what_to_glue = _flatten(what_to_glue)
what_to_glue = _flatten(what_to_glue)
# safeguard against nonstrings
return " ".join([str(x) for x in what_to_glue])