Bug #1480 (closed)
Opened 10 years ago
Closed 10 years ago
Test for "/" will not hold true on Windows
| Reported by: | jamoore | Owned by: | cblackburn |
|---|---|---|---|
| Priority: | blocker | Cc: | jnj-support@… |
| Sprint: | n.a. | ||
| Total Remaining Time: | n.a. |
Description
The fileInNewDir won't work on Windows:
def fileInNewDir(self, fileId):
"""
Is the file in one of the new and as yet unimported directories?
"""
dirName = pathModule.path(fileId).dirname()
while dirName != '/' and dirName not in self.newDirs:
dirName = pathModule.path(dirName).dirname()
return dirName
cF.
>>> from path import path
>>> p = path(".")
>>> p
path(u'.')
>>> p.abspath()
path(u'C:\\hudson\\workspace\\omero-windows-integration\\trunk\\dist')
>>> p = p.abspath()
>>> p.dirname()
path(u'C:\\hudson\\workspace\\omero-windows-integration\\trunk')
>>> p = p.dirname()
...
>>> p
path(u'C:\\')
>>> p = p.dirname()
>>> p
path(u'C:\\')
>>> p == "/"
False
>>> p == "C:\\"
True
>>>
Change History (1)
comment:1 Changed 10 years ago by jmoore
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
r5047