Revision: 0ebe7536361f
Author: Anssi Syrjäsalo <anssi.syrjas...@eficode.com>
Date: Fri Jul 26 05:01:03 2013
Log: Reorganized test data
http://code.google.com/p/robotframework-sshlibrary/source/detail?r=0ebe7536361f
Added:
/atest/resources/textfiles/aaääöö.txt
/atest/resources/textfiles/file_with_newlines.txt
/atest/resources/textfiles/foo%2Fbar.txt
/atest/resources/textfiles/test_file.txt
/atest/resources/textfiles/test_file2.txt
Deleted:
/atest/resources/scripts/aaääöö.txt
/atest/resources/scripts/file_with_newlines.txt
/atest/resources/scripts/foo%2Fbar.txt
/atest/resources/scripts/test_file.txt
/atest/resources/scripts/test_file2.txt
Modified:
/atest/put_file.txt
/atest/resources/ssh_library_resources.txt
/src/SSHLibrary/abstractclient.py
=======================================
--- /dev/null
+++ /atest/resources/textfiles/aaääöö.txt Fri Jul 26 05:01:03 2013
@@ -0,0 +1,4 @@
+This is a test file used to test non-ASCII character encoding
+
+ää
+öö
=======================================
--- /dev/null
+++ /atest/resources/textfiles/file_with_newlines.txt Fri Jul 26 05:01:03
2013
@@ -0,0 +1,4 @@
+
+This is a test file used in Get File and Put File tests.
+
+And it contains newlines.
=======================================
--- /dev/null
+++ /atest/resources/textfiles/foo%2Fbar.txt Fri Jul 26 05:01:03 2013
@@ -0,0 +1,1 @@
+This is a test file used in Get File and Put File tests.
=======================================
--- /dev/null
+++ /atest/resources/textfiles/test_file.txt Fri Jul 26 05:01:03 2013
@@ -0,0 +1,1 @@
+This is a test file used in Get File and Put File tests.
=======================================
--- /dev/null
+++ /atest/resources/textfiles/test_file2.txt Fri Jul 26 05:01:03 2013
@@ -0,0 +1,1 @@
+This is another test file used in Get File and Put File tests.
=======================================
--- /atest/resources/scripts/aaääöö.txt Mon Jul 8 04:16:30 2013
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a test file used to test non-ASCII character encoding
-
-ää
-öö
=======================================
--- /atest/resources/scripts/file_with_newlines.txt Thu Feb 26 22:16:03 2009
+++ /dev/null
@@ -1,4 +0,0 @@
-
-This is a test file used in Get File and Put File tests.
-
-And it contains newlines.
=======================================
--- /atest/resources/scripts/foo%2Fbar.txt Thu Aug 30 00:50:42 2012
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a test file used in Get File and Put File tests.
=======================================
--- /atest/resources/scripts/test_file.txt Thu Feb 26 22:16:03 2009
+++ /dev/null
@@ -1,1 +0,0 @@
-This is a test file used in Get File and Put File tests.
=======================================
--- /atest/resources/scripts/test_file2.txt Thu Feb 26 22:16:03 2009
+++ /dev/null
@@ -1,1 +0,0 @@
-This is another test file used in Get File and Put File tests.
=======================================
--- /atest/put_file.txt Wed Jul 10 06:47:18 2013
+++ /atest/put_file.txt Fri Jul 26 05:01:03 2013
@@ -62,7 +62,7 @@
[Teardown] Execute Command rm -rf robotdir
Put File With Pattern Matching Directory
- Put Files And Verify ${SCRIPTS}test_fi* ${USER HOME}/ ${TEST FILE
NAME} ${TEST FILE 2 NAME}
+ Put Files And Verify ${TEXTFILES}test_fi* ${USER HOME}/ ${TEST FILE
NAME} ${TEST FILE 2 NAME}
[Teardown] Execute Command rm -f ${TEST FILE NAME} ${TEST FILE 2
NAME}
Put File Should Fail When There Are No Source Files
@@ -71,7 +71,7 @@
Put File with special characters in filename
[Documentation]
http://code.google.com/p/robotframework-sshlibrary/issues/detail?id=55
Enable SSH Logging ${TEMPDIR}${/}ssh_log.txt
- Put File ${SPECIAL CHARS FILE} ${USER HOME}/robotdir/
+ Put File ${FILE WITH SPECIAL CHARS} ${USER HOME}/robotdir/
Verify Remote Files Exist robotdir foo%2Fbar.txt
[Teardown] Execute Command rm -rf robotdir
=======================================
--- /atest/resources/ssh_library_resources.txt Mon Jul 8 04:16:30 2013
+++ /atest/resources/ssh_library_resources.txt Fri Jul 26 05:01:03 2013
@@ -5,6 +5,7 @@
*** Variables ***
${SCRIPTS} ${CURDIR}${/}scripts${/}
+${TEXTFILES} ${CURDIR}${/}textfiles${/}
${TEST SCRIPT NAME} test.sh
${TEST SCRIPT} ${SCRIPTS}${TEST SCRIPT NAME}
${INTERACTIVE TEST SCRIPT NAME} test_interactive.sh
@@ -13,15 +14,16 @@
${REPEAT TEST SCRIPT} ${SCRIPTS}${REPEAT TEST SCRIPT NAME}
${COUNTER NAME} counter.txt
${TEST FILE NAME} test_file.txt
-${TEST FILE} ${SCRIPTS}${TEST FILE NAME}
+${TEST FILE} ${TEXTFILES}${TEST FILE NAME}
${TEST FILE 2 NAME} test_file2.txt
-${TEST FILE 2} ${SCRIPTS}${TEST FILE 2 NAME}
-${TEST FILE PATTERN} ${SCRIPTS}test*.txt
+${TEST FILE 2} ${TEXTFILES}${TEST FILE 2 NAME}
+${TEST FILE PATTERN} ${TEXTFILES}test*.txt
${FILE WITH NEWLINES NAME} file_with_newlines.txt
-${FILE WITH NEWLINES} ${SCRIPTS}${FILE WITH NEWLINES NAME}
+${FILE WITH NEWLINES} ${TEXTFILES}${FILE WITH NEWLINES NAME}
${FILE WITH NON-ASCII NAME} aaääöö.txt
-${FILE WITH NON-ASCII} ${SCRIPTS}${FILE WITH NON-ASCII NAME}
-${SPECIAL CHARS FILE} ${SCRIPTS}foo%2Fbar.txt
+${FILE WITH NON-ASCII} ${TEXTFILES}${FILE WITH NON-ASCII NAME}
+${FILE WITH SPECIAL CHARS NAME} foo%2Fbar.txt
+${FILE WITH SPECIAL CHARS} ${TEXTFILES}${FILE WITH SPECIAL CHARS NAME}
*** Keywords ***
Login And Move Test Files
=======================================
--- /src/SSHLibrary/abstractclient.py Thu Jul 25 07:09:43 2013
+++ /src/SSHLibrary/abstractclient.py Fri Jul 26 05:01:03 2013
@@ -376,16 +376,16 @@
self._put_file(src, dst, mode, newline)
return localfiles, remotefiles
- def _put_file(self, source, dest, mode, newline_char):
- remotefile = self._create_remote_file(dest, mode)
+ def _put_file(self, source, destination, mode, newline):
+ remotefile = self._create_remote_file(destination, mode)
with open(source, 'rb') as localfile:
position = 0
while True:
data = localfile.read(4096)
if not data:
break
- if newline_char and '\n' in data:
- data = data.replace('\n', newline_char)
+ if newline and '\n' in data:
+ data = data.replace('\n', newline)
self._write_to_remote_file(remotefile, data, position)
position += len(data)
self._close_remote_file(remotefile)
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.