3 new revisions:

Revision: 17adfa60bed8
Author:   Pekka Klärck
Date:     Mon Feb 20 05:37:56 2012
Log:      import cleanup
http://code.google.com/p/robotframework/source/detail?r=17adfa60bed8

Revision: de7580381b14
Author:   Pekka Klärck
Date:     Mon Feb 20 06:37:52 2012
Log:      Dialogs: doc cleanup
http://code.google.com/p/robotframework/source/detail?r=de7580381b14

Revision: 76a0bab778f4
Author:   Pekka Klärck
Date:     Mon Feb 20 06:38:55 2012
Log:      libdoc/console viewer: better tests...
http://code.google.com/p/robotframework/source/detail?r=76a0bab778f4

==============================================================================
Revision: 17adfa60bed8
Author:   Pekka Klärck
Date:     Mon Feb 20 05:37:56 2012
Log:      import cleanup
http://code.google.com/p/robotframework/source/detail?r=17adfa60bed8

Modified:
 /src/robot/model/filter.py
 /src/robot/model/tags.py

=======================================
--- /src/robot/model/filter.py  Wed Nov  9 09:48:30 2011
+++ /src/robot/model/filter.py  Mon Feb 20 05:37:56 2012
@@ -12,11 +12,11 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.

-from robot import utils
-
-from tags import TagPatterns
-from namepatterns import SuiteNamePatterns, TestNamePatterns
-from visitor import SuiteVisitor
+from robot.utils import setter
+
+from .tags import TagPatterns
+from .namepatterns import SuiteNamePatterns, TestNamePatterns
+from .visitor import SuiteVisitor


 class Filter(SuiteVisitor):
@@ -28,21 +28,21 @@
         self.include_tags = include_tags
         self.exclude_tags = exclude_tags

-    @utils.setter
+    @setter
     def include_suites(self, suites):
         return SuiteNamePatterns(suites) \
             if not isinstance(suites, SuiteNamePatterns) else suites

-    @utils.setter
+    @setter
     def include_tests(self, tests):
         return TestNamePatterns(tests) \
             if not isinstance(tests, TestNamePatterns) else tests

-    @utils.setter
+    @setter
     def include_tags(self, tags):
return TagPatterns(tags) if not isinstance(tags, TagPatterns) else tags

-    @utils.setter
+    @setter
     def exclude_tags(self, tags):
return TagPatterns(tags) if not isinstance(tags, TagPatterns) else tags

=======================================
--- /src/robot/model/tags.py    Fri Nov  4 22:48:40 2011
+++ /src/robot/model/tags.py    Mon Feb 20 05:37:56 2012
@@ -12,7 +12,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.

-from robot import utils
+from robot.utils import normalize_tags, setter, Matcher


 class Tags(object):
@@ -20,11 +20,11 @@
     def __init__(self, tags=None):
         self._tags = tags

-    @utils.setter
+    @setter
     def _tags(self, tags):
         if isinstance(tags, basestring):
             tags = [tags]
-        return utils.normalize_tags(tags or [])
+        return normalize_tags(tags or [])

     def add(self, tags):
         self._tags = list(self) + list(Tags(tags))
@@ -86,7 +86,7 @@
 class _SingleTagPattern(object):

     def __init__(self, pattern):
-        self._matcher = utils.Matcher(pattern, ignore=['_'])
+        self._matcher = Matcher(pattern, ignore=['_'])

     def match(self, tags):
         return any(self._matcher.match(tag) for tag in tags)

==============================================================================
Revision: de7580381b14
Author:   Pekka Klärck
Date:     Mon Feb 20 06:37:52 2012
Log:      Dialogs: doc cleanup
http://code.google.com/p/robotframework/source/detail?r=de7580381b14

Modified:
 /src/robot/libraries/Dialogs.py

=======================================
--- /src/robot/libraries/Dialogs.py     Fri Jan 27 04:17:17 2012
+++ /src/robot/libraries/Dialogs.py     Mon Feb 20 06:37:52 2012
@@ -45,17 +45,22 @@


def pause_execution(message='Test execution paused. Press OK to continue.'): - """Pauses the test execution and shows dialog with the text `message`."""
+    """Pauses test execution until user clicks `Ok` button.
+
+    `message` is the message shown in the dialog.
+    """
     MessageDialog(message)


 def execute_manual_step(message, default_error=''):
-    """Pauses the test execution until user sets the keyword status.
-
-    `message` is the instruction shown in the dialog. User can select
-    PASS or FAIL, and in the latter case an additional dialog is
-    opened for defining the error message. `default_error` is the
-    possible default value shown in the error message dialog.
+    """Pauses test execution until user sets the keyword status.
+
+    User can select 'PASS' or 'FAIL', and in the latter case an additional
+    dialog is opened for defining the error message.
+
+    `message` is the instruction shown in the initial dialog and
+ `default_error` is the default value shown in the possible error message
+    dialog.
     """
     if not PassFailDialog(message).result:
         msg = get_value_from_user('Give error message:', default_error)
@@ -63,19 +68,19 @@


 def get_value_from_user(message, default_value=''):
-    """Pauses the test execution and asks user to input a value.
-
- `message` is the instruction shown in the dialog. `default_value` is the - possible default value shown in the input field. Selecting 'Cancel' fails
-    the keyword.
+    """Pauses test execution and asks user to input a value.
+
+    `message` is the instruction shown in the dialog and `default_value` is
+    the possible default value shown in the input field. Selecting 'Cancel'
+    fails the keyword.
     """
     return _validate_user_input(InputDialog(message, default_value).result)


 def get_selection_from_user(message, *values):
-    """Pauses the test execution and asks user to select value
-
-    `message` is the instruction shown in the dialog. and `values` are
+    """Pauses test execution and asks user to select a value.
+
+    `message` is the instruction shown in the dialog and `values` are
     the options given to the user. Selecting 'Cancel' fails the keyword.
     """
     return _validate_user_input(SelectionDialog(message, values).result)

==============================================================================
Revision: 76a0bab778f4
Author:   Pekka Klärck
Date:     Mon Feb 20 06:38:55 2012
Log:      libdoc/console viewer: better tests

Update issue 1061
Tests enhanced. Review and docs missing.
http://code.google.com/p/robotframework/source/detail?r=76a0bab778f4

Modified:
 /atest/robot/libdoc/console_viewer.txt
 /atest/robot/libdoc/libdoc_resource.txt

=======================================
--- /atest/robot/libdoc/console_viewer.txt      Mon Feb 20 04:39:24 2012
+++ /atest/robot/libdoc/console_viewer.txt      Mon Feb 20 06:38:55 2012
@@ -21,34 +21,69 @@
     ...   kw 5

 Show whole library
-    ${output}=    Run Libdoc    Dialogs show
-    Should Start With    ${output}    Dialogs\n=======\nVersion:
-    Should Contain    ${output}    Execute Manual Step\n----
-    Should Contain    ${output}    Get Selection From User\n----
-    Should Contain    ${output}    Get Value From User\n----
-    Should Contain    ${output}    Pause Execution\n----
+    Run Libdoc And Set Output    Dialogs show
+    Should Contain Intro    Dialogs    Version:
+ Should Contain Keyword Execute Manual Step message, default_error=
+    ...    Pauses test execution until user sets the keyword status.
+    Should Contain Keyword    Get Selection From User    message, *values
+    ...    Pauses test execution and asks user to select a value.
+ Should Contain Keyword Get Value From User message, default_value=
+    ...    Pauses test execution and asks user to input a value.
+ Should Contain Keyword Pause Execution message=Test execution paused. Press OK to continue.
+    ...   Pauses test execution until user clicks `Ok` button.
+    ...   ${EMPTY}
+    ...   `message` is the message shown in the dialog.

 Show intro only
-    ${output}=    Run Libdoc    Dialogs SHOW intro
-    Should Start With    ${output}    Dialogs\n=======\nVersion:
-    Should Not Contain    ${output}    Execute Manual Step\n----
-    Should Not Contain    ${output}    Get Selection From User\n----
-    Should Not Contain    ${output}    Get Value From User\n----
-    Should Not Contain    ${output}    Pause Execution\n----
+    ${output}=    Run Libdoc    Telnet SHOW intro
+    Should Contain Intro    Telnet    Version:
+    Should Contain Importing
+    ...    timeout=3.0, newline=CRLF, prompt=None, prompt_is_regexp=False
+    ...    Telnet library can be imported with optional arguments.
+    Should Not Contain Keyword    Open Connection
+    Should Not Contain Keyword    Write

 Show intro and keywords
${output}= Run Libdoc ${TESTDATADIR}/resource.txt SHOW NONASC* INTRO
-    Should Start With    ${output}    resource\n========\nNamed arguments:
-    ${expected} =    Catenate    SEPARATOR=\n
-    ...    non ascii doc
-    ...    -------------
-    ...    Arguments:${SPACE * 2}[]
-    ...    ${EMPTY}
+    Should Contain Intro    resource    Named arguments:${SPACE*2}supported
+    Should Contain Keyword    non ascii doc    ${EMPTY}
     ...    Hyvää yötä.
     ...    ${EMPTY}
     ...    Спасибо!
-    Should Contain    ${output}    ${expected}

 Show version
Run Libdoc And Verify Output ${TESTDATADIR}/module.py version 0.1-alpha Run Libdoc And Verify Output ${TESTDATADIR}/resource.txt version N/A
+
+*** Keywords ***
+Should Contain Intro
+    [Arguments]    ${name}    @{meta}
+    ${underline} =    Evaluate    '='*len('${name}')
+    ${expected} =    Catenate    SEPARATOR=\n
+    ...    ${name}
+    ...    ${underline}
+    ...    @{meta}
+    Should Contain    ${OUTPUT}    ${expected}
+
+Should Contain Keyword
+    [Arguments]    ${name}    ${args}    @{doc}
+    ${underline} =    Evaluate    '-'*len('${name}')
+    ${expected} =    Catenate    SEPARATOR=\n
+    ...    ${name}
+    ...    ${underline}
+    ...    Arguments:${SPACE * 2}[${args}]
+    ...    ${EMPTY}
+    ...    @{doc}
+    Should Contain    ${OUTPUT}    ${expected}
+
+Should Contain Importing
+    [Arguments]    ${args}    @{doc}
+    Should Contain Keyword    Importing    ${args}    @{doc}
+
+Should Not Contain Keyword
+    [Arguments]    ${name}
+    ${underline} =    Evaluate    '-'*len('${name}')
+    ${expected} =    Catenate    SEPARATOR=\n
+    ...    ${name}
+    ...    ${underline}
+    Should Not Contain    ${OUTPUT}    ${expected}
=======================================
--- /atest/robot/libdoc/libdoc_resource.txt     Thu Feb 16 03:42:26 2012
+++ /atest/robot/libdoc/libdoc_resource.txt     Mon Feb 20 06:38:55 2012
@@ -10,6 +10,11 @@
 ${OUTHTML}        ${OUTPREFIX}.html

 *** Keywords ***
+Run Libdoc And Set Output
+    [Arguments]    ${arguments}
+    ${OUTPUT}=    Run Libdoc    ${arguments}
+    Set Suite Variable    ${OUTPUT}
+
 Run Libdoc And Parse Output
     [Arguments]    ${arguments}
     Run Libdoc     ${arguments} ${OUTXML}

Reply via email to