-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathtest.py
45 lines (35 loc) · 1.34 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import unittest
from onlinesimru import Driver
class TestSum(unittest.TestCase):
def test_free(self):
driver = Driver("90b7beba2e36054e19ec87ec1855ca46")
data = driver.free().get_countries()
self.assertIsNotNone(data)
def test_numbers(self):
driver = Driver("90b7beba2e36054e19ec87ec1855ca46")
data = driver.numbers().tariffs()
self.assertIsNotNone(data)
self.assertTrue('7' in data)
data = driver.numbers().tariffsOne(7)
self.assertIsNotNone(data)
self.assertEqual(data['code'], 7)
def test_proxy(self):
driver = Driver("90b7beba2e36054e19ec87ec1855ca46")
data = driver.proxy().tariffs()
self.assertIsNotNone(data)
self.assertEqual(data['response'], '1')
def test_rent(self):
driver = Driver("90b7beba2e36054e19ec87ec1855ca46")
data = driver.rent().get_tariff()
self.assertIsNotNone(data)
self.assertTrue(data.code == 7)
def test_user(self):
driver = Driver("90b7beba2e36054e19ec87ec1855ca46")
data = driver.user().balance()
self.assertIsNotNone(data)
self.assertEqual(data['response'], '1')
self.assertTrue('response' in data)
self.assertTrue('balance' in data)
self.assertTrue('income' in data)
if __name__ == '__main__':
unittest.main()