Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#1608 closed defect (fixed)

Hardcoded temporary enviornment path causes attachment unit tests to fail on Windows

Reported by: Ian Leader <__ian.leader__@…> 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)

platform_independant_attachment_test_fix_r1739.diff (2.3 KB ) - added by Ian Leader <__ian.leader__@…> 19 years ago.
Patch to fix fails in attachment unit tests

Download all attachments as: .zip

Change History (4)

by Ian Leader <__ian.leader__@…>, 19 years ago

Patch to fix fails in attachment unit tests

comment:1 by Christian Boos, 19 years ago

Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

Going on with this one…

comment:2 by Christian Boos, 19 years ago

Resolution: fixed
Status: assignedclosed

Patch applied in [1741]

comment:3 by Christian Boos, 17 years ago

Milestone: 0.9

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.