UserApi_Test - test getuserbytoken with valid,invalid and empty string
CampusesApi_test - with valid,invalid string
This commit is contained in:
parent
9ea00145f9
commit
aaa5ba223a
2 changed files with 13 additions and 9 deletions
|
@ -3,6 +3,7 @@ import unittest
|
|||
import requests
|
||||
from Testing.config import __CONFIG__
|
||||
class UserTestPlan(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
debug = __CONFIG__['DEBUG']
|
||||
if debug:
|
||||
|
@ -14,13 +15,16 @@ class UserTestPlan(unittest.TestCase):
|
|||
if 200 <= request.status_code <= 299:
|
||||
print 'Initialized'
|
||||
|
||||
def test_Campuses_invalid(self):
|
||||
def test_Campuses_invalidToken(self):
|
||||
r = requests.get(self.__class__.url_+'api/Campuses/invalidtoken')
|
||||
self.assertEquals(r.status_code, 403)
|
||||
def test_Campuses_valid(self):
|
||||
|
||||
def test_Campuses_validToken_testArraySize(self):
|
||||
r = requests.get(self.__class__.url_+'api/Campuses/'+__CONFIG__['TOKENS']['STUDENT'])
|
||||
self.assertEquals(r.status_code, 200)
|
||||
self.assertEquals(r.json()['username'], 'qa_student')
|
||||
self.assertTrue(len(r.json())>= 1)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Loading…
Reference in a new issue