Created
November 26, 2010 16:56
-
-
Save rcmachado/716952 to your computer and use it in GitHub Desktop.
Custom action
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
from pyccuracy.actions import ActionBase | |
class SendSMSAction(ActionBase): | |
regex = r'^(And )?I send a SMS to [\"](?P<short_number>\d+)[\"] with [\"](?P<message>.+)[\"] as [\"](?P<msisdn>\d+)[\"]$' | |
def execute(self, context, short_number, message, msisdn): | |
url = "http://myserver/dispatcher.php?MESSAGE=" + message + "&SENDERID=" + msisdn + "&PHONEID=" + short_number | |
self.execute_action(u"I go to \"{0}\"".format(url), context) |
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
As a user | |
I want to make a request | |
So that test my custom action | |
Scenario 1 - Make request | |
Given | |
# pre conditions | |
When | |
I send a SMS to "99999" with "mytext" as "559988776655" | |
Then | |
# Nothing to do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment