hlamer/enki — pull request #206 by bjones1 (2014-05-07 19:10:12+00:00)
Title: Fix: Make sure test file x can be removed after chmod-ing it.

On Windows, the first run of test_open_file works (sort of), but the second fails because one of the test files (x) can't be removed. This fix allows x to be removed after each test run, so the tests succeed when run multiple times.

```
C:\Users\bjones\Documents\enki_all\enki\tests\test_core>python -m unittest -v test_open_file
test_1 (test_open_file.Loop) ... Traceback (most recent call last):
File "test_open_file.py", line 72, in func
AttributeError: 'NoneType' object has no attribute 'addAction'
ok
test_2 (test_open_file.Loop) ... Traceback (most recent call last):
File "test_open_file.py", line 85, in func
AttributeError: 'NoneType' object has no attribute 'setCurrentDocument'
ok
test_1 (test_open_file.OpenFail) ... ok
test_2 (test_open_file.OpenFail) ... ok
test_3 (test_open_file.OpenFail) ... ok
test_4 (test_open_file.OpenFail) ... ok
test_1 (test_open_file.Test) ... ok

----------------------------------------------------------------------
Ran 7 tests in 40.429s

OK

C:\Users\bjones\Documents\enki_all\enki\tests\test_core>python -m unittest -v test_open_file
test_1 (test_open_file.Loop) ... Traceback (most recent call last):
File "test_open_file.py", line 72, in func
AttributeError: 'NoneType' object has no attribute 'addAction'
ok
test_2 (test_open_file.Loop) ... ERROR
test_1 (test_open_file.OpenFail) ... ok
test_2 (test_open_file.OpenFail) ... ok
test_3 (test_open_file.OpenFail) ... ERROR
test_4 (test_open_file.OpenFail) ... ERROR
test_1 (test_open_file.Test) ... ok

======================================================================
ERROR: test_2 (test_open_file.Loop)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_open_file.py", line 81, in test_2
File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 207, in createFile
with open(path, 'wb') as file_:
IOError: [Errno 13] Permission denied: 'c:\\users\\bjones\\appdata\\local\\temp\
\enki-tests\\x'

======================================================================
ERROR: test_3 (test_open_file.OpenFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_open_file.py", line 47, in test_3
File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 207, in createFile
with open(path, 'wb') as file_:
IOError: [Errno 13] Permission denied: 'c:\\users\\bjones\\appdata\\local\\temp\
\enki-tests\\x'

======================================================================
ERROR: test_4 (test_open_file.OpenFail)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_open_file.py", line 59, in test_4
File "C:\Users\bjones\Documents\enki_all\enki\tests\test_core\..\base.py", lin
e 207, in createFile
with open(path, 'wb') as file_:
IOError: [Errno 13] Permission denied: 'c:\\users\\bjones\\appdata\\local\\temp\
\enki-tests\\x'

----------------------------------------------------------------------
Ran 7 tests in 20.350s

FAILED (errors=3)
```