blob: 650ed569cc68ea7c64cea7dc37d840b3249199bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import unittest
import mock
import json
from api.views import Test
class TestTestCase(unittest.TestCase):
@mock.patch('api.views.request')
def test_post(self, mock_request):
mock_request.json.get.side_effect = ['runTestSuite', {}]
result = json.loads(Test().post())
self.assertEqual('error', result['status'])
def main():
unittest.main()
if __name__ == '__main__':
main()
|