[Scons-users] Writing test cases for Issue 2615

Dirk Bächle tshortik at gmx.de
Mon Sep 5 12:02:57 EDT 2016


Hi Adarsh,

the "test_*" methods themselves shouldn't "return" (=possibly skipping parts of the test) and for the basic checking of exceptions 
you might want to have a look at "test_warning()" in the same file.

To my knowledge there is no function built-in to SCons for checking the attributes of a directory entry, but using Python 
modules/packages is fine in general.

Best regards,

Dirk

On 04.09.2016 08:51, Adarsh Sanjeev wrote:
> Hi,
>
> I am trying to solve Issue 2615 on the tracker (No error on create Cache in read only directory).
>
> I have, so far, added another test case to engine/Scons/CacheDirTests.py, where I make the directory read only and calls the
> CacheDir constructor there. If it finishes the constructor without any exception, I fail the test.
>
> These
> <https://bitbucket.org/adarshsanjeev/scons/src/b1abe00dc4b82697f6a3b508ecffca359a4712f2/src/engine/SCons/CacheDirTests.py?at=default&fileviewer=file-view-default#CacheDirTests.py-90>
> are the changes I made. Is this okay so far?
>
> On fixing the issue itself, is there any function within scons to check if a directory is writable or should I just use the os module?
>
> --
> Adarsh Sanjeev
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>



More information about the Scons-users mailing list