Skip to content

Instantly share code, notes, and snippets.

@rcmachado
Created November 26, 2010 16:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcmachado/716952 to your computer and use it in GitHub Desktop.
Save rcmachado/716952 to your computer and use it in GitHub Desktop.
Custom action
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)
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