-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from greensms-ru/first-draft
Updated Validations, Social API and Attribute handling for Response
- Loading branch information
Showing
16 changed files
with
149 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from default import client | ||
|
||
|
||
def social_send(): | ||
dict_params = { | ||
'to': '71231234567', | ||
'txt': 'Test Message Hampshire', | ||
'from': 'PyTest', | ||
'tag': 'PyTest', | ||
'hidden': 'Hampshire' | ||
} | ||
|
||
res = client.social.send(**dict_params) | ||
print(res) | ||
|
||
|
||
def social_status(): | ||
res = client.social.status(id='caf3efb1-8aca-4387-9ed0-e667d315c5c9') | ||
print(res) | ||
|
||
|
||
if __name__ == '__main__': | ||
social_send() | ||
|
||
social_status() |
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
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
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
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
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
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,33 @@ | ||
import unittest | ||
from tests.default import client | ||
from tests.utils import random_phone | ||
|
||
|
||
class TestSocialMethods(unittest.TestCase): | ||
|
||
def test_send(self): | ||
dict_params = { | ||
'to': random_phone(), | ||
'txt': 'Test Message Hampshire', | ||
'from': 'PyTest', | ||
'tag': 'PyTest', | ||
'hidden': 'Hampshire' | ||
} | ||
|
||
response = client.social.send(**dict_params) | ||
self.assertIn('request_id', response) | ||
|
||
def test_mandatory_to(self): | ||
try: | ||
client.social.send() | ||
except Exception as e: | ||
self.assertEqual(e.error, 'Validation Error') | ||
|
||
def test_status(self): | ||
response = client.social.status( | ||
id='caf3efb1-8aca-4387-9ed0-e667d315c5c9') | ||
self.assertIn('status', response) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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
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