sileht / python-jsonpath-rw-ext

Extensions for JSONPath RW
Apache License 2.0
59 stars 19 forks source link

feature: adding regex match filter #16

Closed shhgs closed 6 years ago

shhgs commented 6 years ago

Thank you for this project.

I am new to jsonpath, and not familiar with the detailed specifications. I don't know if the regex match and the '~' operatator is acceptable. Howver I found this feature can be very useful and also is very easy to implement. Therefore I hacked the code and submit it to you.

I didn't write the testcase because I don't know how to use oslotest. It is brand new to me.

Thanks -Jon

sileht commented 6 years ago

That's a neat feature, thx!

That's just need at least one test :)

oslotest is just a couple of helpers on top of standard testtools/unittest library.

Just copy/paste some existing assertions should be enough, for example this one:

https://github.com/sileht/python-jsonpath-rw-ext/blob/master/jsonpath_rw_ext/tests/test_jsonpath_rw_ext.py#L105-L116

sileht commented 6 years ago

I have done something wrong with this PR, so I have repropose your change here and I have added the missing test: https://github.com/sileht/python-jsonpath-rw-ext/pull/17