[GRASS-dev] Regarding testing

Sanjeet edu.sanjeet at gmail.com
Mon May 7 22:39:56 PDT 2018

On Fri, May 4, 2018 at 10:23 PM, Anna Petrášová <kratochanna at gmail.com> wrote:
> On Fri, May 4, 2018 at 1:19 PM, Sanjeet <edu.sanjeet at gmail.com> wrote:
>> Also, I was wondering if there is any priority for working with testsuites?
> Look at the tests in Python scripting library
> (lib/python/script/testsuite). Test it under Python 3 to see how they
> work, specifically test_utils.py will definitely fail for Python 3,
> there will be changes needed in utils.py and its test to make it work
> (we can discuss those). I am not sure if the other tests work with
> Python 3, so let us know. You should try to add some where you feel
> there is not enough testing coverage. Please keep asking if
> something's unclear.

Hi Anna,

I made some minor changes in 'utils.py' in lib/python/script and
'test_utils.py' in its testsuite.

The Python 3's bytes cannot contain ASCII literal characters,
therefore I can't seem to test it as such, I encoded it first before
checking for an assertion, which I am not sure is a correct way to do
so as we are ensuring that we do not pass any bytes with ASCII literal
Same thing is in test_start_command_functions.py.
Moreover, I generalized the encode and decode functions by using
string conversion for int and float values.

Please let me know if this is the correct way to go about it.

Sanjeet Bhatti

More information about the grass-dev mailing list