yanne / api-test

0 stars 0 forks source link

Avoid using Robot's deprecated `utils.matches` in `Get File` #70

Closed yanne closed 10 years ago

yanne commented 10 years ago

After upgrade to RobotFramework 2.8. Using Jython 2.5.4rc1

Get File rise error AttributeError: 'module' object has no attribute 'matches'

SSHLibrary.Get File /data/rhino/log/system/config.log.1 ${WORKING DIR}\t.1

This issue was originally opened at Google Code on Jun 13, 2013.

yanne commented 10 years ago

Original comment by pekka.klarck on Jun 13, 2013.

This is due to utils.matches utility function being removed in RF 2.8. This was already reported in RF's tracker [1] and we decided to add utils.matches back at least temporarily in RF 2.8.1.

SSHLibrary needs to also be changed so that it doesn't use utils.matches anymore. I looked at the code and it seems that it can actually be replaced with Python's fnmatch.fnmatchcase [2].

[1] https://code.google.com/p/robotframework/issues/detail?id=1472

[2] http://docs.python.org/2/library/fnmatch.html

yanne commented 10 years ago

Original comment by anssi.sy...@eficode.com on Jun 18, 2013.

This was fixed by https://code.google.com/p/robotframework-sshlibrary/source/detail?r=2b1c23a6d24af5100d4dc142d260e8f69aa489ae

yanne commented 10 years ago

Original comment by pekka.klarck on Oct 17, 2013.

This change is good but I just realized it changes the behavior a little. Earlier matching was case and also space insensitive and now it is not. The new functionality is definitely better so no need to change the code. Matching being case sensitive regardless the operating system is something that should be mentioned in the documentation, though. I also added bwic label so that we remember to mention this potentially backwards incompatible change in the release notes.

yanne commented 10 years ago

Original comment by robotframework@gmail.com on Oct 24, 2013.

This issue was updated by revision ff45b515c1c6 .

A note about case-sensitivity had already been added. Fine-tuned it a little.