source: ogServer-Git/tests/units/test_0001_get_clients.py @ 46d791a

Last change on this file since 46d791a was 880cc90, checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago

#915 Improve test output using unittest discover

  • Call the tests with python module unittest. In particular, the discover function.
  • Rename tests files to meet the default requirements of discover function.
  • Property mode set to 100644
File size: 564 bytes
Line 
1import requests
2import unittest
3
4class TestGetClientsMethods(unittest.TestCase):
5
6    def setUp(self):
7        self.url = 'http://localhost:8888/clients'
8        self.headers = {'Authorization' : '07b3bfe728954619b58f0107ad73acc1'}
9
10    def test_get(self):
11        returned = requests.get(self.url, headers=self.headers)
12        self.assertEqual(returned.status_code, 200)
13
14    def test_post(self):
15        returned = requests.post(self.url, headers=self.headers)
16        self.assertEqual(returned.status_code, 404)
17
18if __name__ == '__main__':
19    unittest.main()
Note: See TracBrowser for help on using the repository browser.