Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 2c2d25c

Browse files
committed
Create setup.cfg for publishing to pypi
1 parent d1caaf2 commit 2c2d25c

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

pysnap/utils.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
1515
from cryptography.hazmat.backends import default_backend
1616

17-
BASE_URL = 'https://feelinsonice-hrd.appspot.com/'
18-
LOGIN_BASE_URL = 'https://app.snapchat.com/'
17+
URL = 'https://feelinsonice-hrd.appspot.com/'
18+
AUTH_URL = 'https://app.snapchat.com/'
1919

2020
SECRET = b'iEk21fuwZApXlz93750dmW22pw389dPwOk'
2121
STATIC_TOKEN = 'm198sOkJEn37DjqZ32lpRu76xmw288xSQ9'
@@ -79,15 +79,16 @@ def request(endpoint, auth_token, data=None, files=None,
7979
if data is None:
8080
data = {}
8181
headers = {
82-
'User-Agent': 'Snapchat/9.2.0.0 (A0001; Android 4.4.4#5229c4ef56#19; gzip)',
82+
'User-Agent': 'Snapchat/9.2.0.0 (A0001; '
83+
'Android 4.4.4#5229c4ef56#19; gzip)',
8384
'Accept-Language': 'en-US;q=1, en;q=0.9',
8485
'Accept-Locale': 'en'
8586
}
8687

8788
if endpoint == 'login':
88-
url = LOGIN_BASE_URL + 'loq/'
89+
url = AUTH_URL + 'loq/'
8990
else:
90-
url = BASE_URL + 'bq/'
91+
url = URL + 'bq/'
9192

9293
if req_type == 'post':
9394
data.update({

setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[metadata]
2+
description-file = README.md

tests/pysnap_tests.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from requests.exceptions import HTTPError
88

99
from pysnap import is_image, is_video, Snapchat
10-
from pysnap.utils import make_request_token, pkcs5_pad, URL
10+
from pysnap.utils import make_request_token, pkcs5_pad, URL, AUTH_URL
1111

1212

1313
class ModuleTestCase(unittest.TestCase):
@@ -44,7 +44,7 @@ def setUp(self):
4444

4545
@responses.activate
4646
def test_login(self):
47-
login_url = URL[0:-3] + 'loq/login'
47+
login_url = AUTH_URL + 'loq/login'
4848

4949
responses.add(responses.POST, login_url,
5050
body='{"updates_response": \
@@ -76,19 +76,19 @@ def test_login(self):
7676

7777
@responses.activate
7878
def test_logout(self):
79-
responses.add(responses.POST, URL + 'logout',
79+
responses.add(responses.POST, URL + 'bq/logout',
8080
body='', status=200,
8181
content_type='application/json')
8282
self.assertTrue(self.snapchat.logout())
8383

8484
responses.reset()
85-
responses.add(responses.POST, URL + 'logout',
85+
responses.add(responses.POST, URL + 'bq/logout',
8686
body='{}', status=404,
8787
content_type='application/json')
8888
self.assertRaises(HTTPError, self.snapchat.logout)
8989

9090
responses.reset()
91-
responses.add(responses.POST, URL + 'logout',
91+
responses.add(responses.POST, URL + 'bq/logout',
9292
body='{}', status=200,
9393
content_type='application/json')
9494
self.assertFalse(self.snapchat.logout())

0 commit comments

Comments
 (0)