Revision: 3251
Author: janne.t.harkonen
Date: Tue May 11 00:22:47 2010
Log: more tests for dry run
http://code.google.com/p/robotframework/source/detail?r=3251

Added:
 /trunk/atest/testdata/cli/dryrun
 /trunk/atest/testdata/cli/dryrun/dryrun.txt
Deleted:
 /trunk/atest/testdata/cli/dryrun.txt
Modified:
 /trunk/atest/robot/cli/runner/dryrun.txt

=======================================
--- /dev/null
+++ /trunk/atest/testdata/cli/dryrun/dryrun.txt Tue May 11 00:22:47 2010
@@ -0,0 +1,56 @@
+*** Settings ***
+Library  OperatingSystem
+Variables  vars.py
+Resource  ${RESOURCE PATH}
+
+Library  DoesNotExist
+Variables  wrong_path.py
+Resource  NonExisting.tsv
+
+
+*** Test Cases ***
+
+No Failures
+    Log  Hello from test
+    ${contents}=  List Directory  .
+    Simple UK
+
+Failures
+    Fail
+    Fail In Uk
+    No Operation
+
+For Loops
+ [Documentation] FAIL Keyword 'resource.Anarchy In The UK' expected 3 arguments, got 2.
+    ::FOR  ${i}  IN RANGE  10
+    \   Log  ${i}
+    \   Simple UK
+    For Loop in UK
+    ::FOR  ${a}  ${b}  IN RANGE  2
+    \   Anarchy in the UK  1  2
+
+Non-existing keyword name
+    [ Documentation ]  FAIL No keyword with name 'Does not exist' found.
+    Does not exist
+
+Too few arguments
+ [Documentation] FAIL Keyword 'BuiltIn.Should Be Equal' expected 2 to 4 arguments, got 1.
+    Should Be Equal  1
+
+Too few arguments for UK
+ [Documentation] FAIL Keyword 'resource.Anarchy In The UK' expected 3 arguments, got 1.
+    Anarchy in the UK  foo
+
+Too many arguments
+ [Documentation] FAIL Keyword 'BuiltIn.No Operation' expected 0 arguments, got 2.
+    No Operation  ${foo}  @{list}
+
+Arguments given as list variable
+ [Documentation] FAIL Keyword 'BuiltIn.Should Be Equal' expected 2 to 4 arguments, got 1.
+    @{list} =  Create List  1  1
+    Should Be Equal  @{list}
+    Anarchy in the UK  @{list}
+    Anarchy in the UK  @{list}  1
+    @{empty list}  Create List
+    Convert to Number   1  @{empty list}  @{empty list}
+    Should Be Equal  @{foo
=======================================
--- /trunk/atest/testdata/cli/dryrun.txt        Mon May 10 00:49:52 2010
+++ /dev/null
@@ -1,55 +0,0 @@
-*** Test Cases ***
-
-No Failures
-    Log  Hello from test
-    Simple UK
-
-Failures
-    Fail
-    Fail In Uk
-    No Operation
-
-For Loops
-    ::FOR  ${i}  IN RANGE  10
-    \   Log  ${i}
-    \   Fail
-    For Loop in UK
-
-Non-existing keyword name
-    [ Documentation ]  FAIL No keyword with name 'Does not exist' found.
-    Does not exist
-
-Wrong Number of Arguments
- [Documentation] FAIL Keyword 'BuiltIn.Should Be Equal' expected 2 to 4 arguments, got 1.
-    Should Be Equal  1
-
-Wrong Number of Arguments for UK
- [Documentation] FAIL Keyword 'Anarchy In The UK' expected 2 arguments, got 1.
-    Anarchy in the UK  foo
-
-Arguments given as list variable
- [Documentation] FAIL Keyword 'BuiltIn.Should Be Equal' expected 2 to 4 arguments, got 1.
-    @{list} =  Create List  1  1
-    Should Be Equal  @{list}
-    Anarchy in the UK  @{list}
-    @{empty list}  Create List
-    Convert to Number   1  @{empty list}
-    Should Be Equal  @{foo
-
-
-*** Keywords ***
-Simple UK
-    Log  Hello from UK
-
-Fail In UK
-    Fail
-    Fail  And again
-
-For Loop in UK
-    ::FOR  ${i}  IN RANGE  10
-    \   Should be Equal  ${i}  0
-    Fail
-
-Anarchy in the UK
-    [Arguments]  ${a1}  ${a2}
-    Fail  ${a1}${2}
=======================================
--- /trunk/atest/robot/cli/runner/dryrun.txt    Mon May 10 00:49:52 2010
+++ /trunk/atest/robot/cli/runner/dryrun.txt    Tue May 11 00:22:47 2010
@@ -1,5 +1,5 @@
 *** Settings ***
-Suite Setup     Run Tests  --runmode dryrun  cli/dryrun.txt
+Suite Setup     Run Tests  --runmode dryrun  cli/dryrun/dryrun.txt
 Force Tags      regression  pybot  jybot
 Resource        atest_resource.txt

@@ -7,8 +7,10 @@

 No Failures
     ${tc}=  Check Test Case  ${TESTNAME}
-    Should have correct number of keywords  ${tc}  2
-    Should have correct number of keywords  ${tc.kws[1]}  1
+    Should have correct number of keywords  ${tc}  3
+    Status should be  ${tc}  PASS
+    Status should be  ${tc.kws[0]}  NOT_RUN
+    Should have correct number of keywords  ${tc.kws[2]}  1

 Failures
     ${tc}=  Check Test Case  ${TESTNAME}
@@ -17,25 +19,40 @@

 For Loops
     ${tc}=  Check Test Case  ${TESTNAME}
-    Should have correct number of keywords  ${tc}  2
+    Should have correct number of keywords  ${tc}  3
     Should have correct number of keywords  ${tc.kws[0]}  1
     Should have correct number of keywords  ${tc.kws[0].kws[0]}  2
-    Should have correct number of keywords  ${tc.kws[1]}  2
+    Should have correct number of keywords  ${tc.kws[1]}  3
+    Should have correct number of keywords  ${tc.kws[1].kws[1]}  1

 Non-existing keyword name
-    ${tc}=  Check Test Case  ${TESTNAME}
-
-Wrong Number of Arguments
-    ${tc}=  Check Test Case  ${TESTNAME}
-
-Wrong Number of Arguments for UK
-    ${tc}=  Check Test Case  ${TESTNAME}
+    Check Test Case  ${TESTNAME}
+
+Too few arguments
+    Check Test Case  ${TESTNAME}
+
+Too few arguments for UK
+    Check Test Case  ${TESTNAME}
+
+Too many arguments
+    Check Test Case  ${TESTNAME}

 Arguments given as list variable
-    ${tc}=  Check Test Case  ${TESTNAME}
+    Check Test Case  ${TESTNAME}
+
+Invalid imports
+ Check Stderr Contains Importing test library 'DoesNotExist' failed: ImportError: No module named DoesNotExist
+    Check Stderr Contains  Variable file 'wrong_path.py' does not exist
+    Check Stderr Contains  Resource file 'NonExisting.tsv' does not exist
+

 *** Keywords ***
 Should have correct number of keywords
     [Arguments]  ${test or uk}  ${exp number of kws}
     Log  ${test or uk.kws}
- Should Be Equal As Integers ${test or uk.kws.__len__()} ${exp number of kws} + Should Be Equal As Integers ${test or uk.kw_count} ${exp number of kws}
+
+Status should be
+    [Arguments]  ${tc or kw}  ${exp status}
+    Should Be Equal  ${tc or kw.status}  ${exp status}
+

Reply via email to