Exemple #1
0
 def __init__(self, api_key, api_uri="https://api.authy.com"):
     """
     Create a Authy REST API client.
     """
     self.api_uri = api_uri
     self.users = Users(api_uri, api_key)
     self.tokens = Tokens(api_uri, api_key)
     self.apps = Apps(api_uri, api_key)
     self.stats = StatsResource(api_uri, api_key)
     self.phones = Phones(api_uri, api_key)
     self.api_key = api_key
    def setUp(self):
        
        self.phones = MagicMock(Phones(test_helper.API_URL, test_helper.API_KEY))
        self.response = MagicMock()

        phone = MagicMock(Phone(self.phones, self.response))
        phone.ok = MagicMock(return_value=True)
        phone.errors = MagicMock(return_value={})

        self.phone_number = test_helper.PHONE_NUMBER
        self.country_code = test_helper.COUNTRY_CODE

        self.phones.__validate_channel = Phones._Phones__validate_channel
        self.phones.__validate_code_length = Phones._Phones__validate_code_length
        self.phones.verification_start = MagicMock(return_value = phone)
Exemple #3
0
 def setUp(self):
     self.api = AuthyApiClient(test_helper.API_KEY, test_helper.API_URL)
     self.phones = Phones(test_helper.API_URL, test_helper.API_KEY)
Exemple #4
0
 def setUp(self):
     self.api = AuthyApiClient(test_helper.API_KEY, test_helper.API_URL)
     self.phones = Phones(test_helper.API_URL, test_helper.API_KEY)
     self.phone_number = test_helper.PHONE_NUMBER
     self.country_code = test_helper.COUNTRY_CODE
Exemple #5
0
 def setUp(self):
     self.api = AuthyApiClient("bf12974d70818a08199d17d5e2bae630",
                               "http://sandbox-api.authy.com")
     self.phones = Phones("http://sandbox-api.authy.com",
                          'bf12974d70818a08199d17d5e2bae630')