-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BuiltIn.robot_running and BuiltIn.dry_run_active
New propertys for libraries and other extensions. Fixes #4666.
- Loading branch information
1 parent
aa1ac6b
commit 2b6c764
Showing
5 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
atest/robot/standard_libraries/builtin/builtin_propertys.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
*** Settings *** | ||
Resource atest_resource.robot | ||
|
||
*** Test Cases *** | ||
Normal run | ||
Run Tests ${EMPTY} standard_libraries/builtin/builtin_propertys.robot | ||
Check Test Case Test propertys | ||
|
||
Dry-run | ||
Run Tests --dryrun --variable DRYRUN:True standard_libraries/builtin/builtin_propertys.robot | ||
Check Test Case Test propertys |
12 changes: 12 additions & 0 deletions
12
atest/testdata/standard_libraries/builtin/BuiltInPropertys.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from robot.libraries.BuiltIn import BuiltIn | ||
|
||
|
||
class BuiltInPropertys: | ||
|
||
def __init__(self, dry_run=False): | ||
assert BuiltIn().robot_running is True | ||
assert BuiltIn().dry_run_active is dry_run | ||
|
||
def keyword(self): | ||
assert BuiltIn().robot_running is True | ||
assert BuiltIn().dry_run_active is False |
9 changes: 9 additions & 0 deletions
9
atest/testdata/standard_libraries/builtin/builtin_propertys.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*** Settings *** | ||
Library BuiltInPropertys.py ${DRYRUN} | ||
|
||
*** Variables *** | ||
${DRYRUN} False | ||
|
||
*** Test Cases *** | ||
Test propertys | ||
Keyword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters