Hi!
I was investigating myself the code to maybe help debugging it and i
found this:
At the pyccuracy.parsers.FileParser, the function get_line_identation
does not correctly calculate the real identation, it only counts space
chars, be it at start or at the end.
At pyccuracy.actions.ActionRegistry the suitable_for function returns
the expected args and kwargs, but for table parameters, it has no
kwargs, and if i put the "(And)?" optional, it will get passed down as
(None,) args, example:
class RegisterUsers(ActionBase):
regex = r'^(And )?I have the following registered users:$'
def execute(self, context, table):
pass
The matches will be (None,) as args and {} as kwargs, following up the
code at FileParser.parse_story_file, it will inject the key 'table' at
kwargs, so the call will be:
execute(self,context,None,table=table)
Thus, raising the exception just like this example:
>>> def x(a,b):
... return a+b
...
>>> x(1,2,b=3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: x() got multiple values for keyword argument 'b'
I hope this helps fixing this problem, i created a quickfix here but i
dont think its the optimal solution, if needed i can publish the fix.
Thanks,
Mauricio Souza Lima
On Feb 15, 9:45 pm, Bernardo Heynemann <
heynem...@gmail.com> wrote:
> Very likely a bug...
>
> I'll check.
>
> Ty,
> Bernardo Heynemann
>