Exemple #1
0
 def test_GetData_ReturnValidFormat_True(self):
     obj = FbExporter(accessToken=TEST_TOKEN)
     resp = obj.getData()
     self.assertIn('retCode', resp)
     self.assertEqual(resp['retCode'], ErrorCode.S_OK)
     self.assertTrue(ErrorCode.IS_SUCCEEDED(resp['retCode']))
     self.assertIn('data', resp)
     self.assertTrue(type(resp['data']), list)
     self.assertIn('count', resp)
     self.assertTrue(type(resp['count']), int)
Exemple #2
0
 def test_IsTokenValid_GivenInValidToken_E_INVALID_TOKEN(self):
     obj = FbExporter(accessToken='invalid_token')
     resp = obj.isTokenValid()
     self.assertEqual(resp, ErrorCode.E_INVALID_TOKEN)
Exemple #3
0
 def test_IsTokenValid_GivenValidToken_S_OK(self):
     obj = FbExporter(accessToken=TEST_TOKEN)
     resp = obj.isTokenValid()
     self.assertEqual(resp, ErrorCode.S_OK)
Exemple #4
0
 def test_GetData_GivenInvalidToken_ReturnInvalidToken(self):
     obj = FbExporter(accessToken='invalid_token')
     resp = obj.getData()
     self.assertIn('retCode', resp)
     self.assertEqual(resp['retCode'], ErrorCode.E_INVALID_TOKEN)