Modify ↓
#1608 closed defect (fixed)
Hardcoded temporary enviornment path causes attachment unit tests to fail on Windows
Reported by: | Owned by: | Christian Boos | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9 |
Component: | general | Version: | devel |
Severity: | normal | Keywords: | PATCH |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Windows XP SP2, Python 2.3.4
On above environment, as of [1739] two unit tests in attachment.py fail because the temporary environment directory is hard-coded in the asserts:
C:\temp\working\trac>python trac\tests\attachment.py .FF... ====================================================================== FAIL: test_get_path (__main__.AttachmentTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "trac\tests\attachment.py", line 35, in test_get_path attachment.path) File "c:\python23\lib\unittest.py", line 302, in failUnlessEqual raise self.failureException, \ AssertionError: '/tmp/trac-tempenv/attachments/ticket/42/foo.txt' != 'c:\\docume ~1\\ianlea~2\\locals~1\\temp\\trac-tempenv\\attachments\\ticket\\42\\foo.txt' ====================================================================== FAIL: test_get_path_encoded (__main__.AttachmentTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "trac\tests\attachment.py", line 45, in test_get_path_encoded attachment.path) File "c:\python23\lib\unittest.py", line 302, in failUnlessEqual raise self.failureException, \ AssertionError: '/tmp/trac-tempenv/attachments/ticket/42/Teh%20foo.txt' != 'c:\\ docume~1\\ianlea~2\\locals~1\\temp\\trac-tempenv\\attachments\\ticket\\42\\Teh%2 0foo.txt' ---------------------------------------------------------------------- Ran 6 tests in 0.181s FAILED (failures=2) C:\temp\working\trac>
A patch is attached to correct this by using the temp environment paths created during setup, and os.path to build the full paths.
Attachments (1)
Change History (4)
by , 20 years ago
Attachment: | platform_independant_attachment_test_fix_r1739.diff added |
---|
comment:3 by , 18 years ago
Milestone: | → 0.9 |
---|
Note:
See TracTickets
for help on using tickets.
Patch to fix fails in attachment unit tests