-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.py
More file actions
59 lines (42 loc) · 2.04 KB
/
Copy pathtest.py
File metadata and controls
59 lines (42 loc) · 2.04 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import unittest
import config
from sigfoxapiv2 import Sigfox
from pprint import pprint
from datetime import datetime, timedelta
from math import trunc
sigfox = Sigfox(config.USERNAME, config.PASSWORD)
class TestSigfoxDeviceEndpoints(unittest.TestCase):
def test_get_device_types(self):
status, _ = sigfox.get_device_types()
self.assertEqual(status, 200, "HTTP status should be 200")
def test_get_device(self):
status, _ = sigfox.get_device(config.TEST_ID)
self.assertEqual(status, 200, "HTTP status should be 200")
def test_get_devices(self):
status, _ = sigfox.get_devices(config.TEST_DEVICE_TYPE_ID)
self.assertEqual(status, 200, "HTTP status should be 200")
def test_get_device_messages(self):
status, _ = sigfox.get_device_messages(config.TEST_ID)
self.assertEqual(status, 200, "HTTP status should be 200")
status, _ = sigfox.get_device_messages(config.TEST_ID, config.TEST_TIMESTAMP)
self.assertEqual(status, 200, "HTTP status should be 200")
def test_get_device_callbacks(self):
status, _ = sigfox.get_device_type_callbacks(config.TEST_DEVICE_TYPE_ID)
self.assertEqual(status, 200, "HTTP status should be 200")
##def test_create_device_callbacks(self):
## status, _ = sigfox.create_device(config.TEST_DEVICE_TYPE_ID)
## self.assertEqual(status, 200, "HTTP status should be 200")
##
##def test_update_device_callbacks(self):
## status, _ = sigfox.update_device(config.TEST_DEVICE_TYPE_ID)
## self.assertEqual(status, 200, "HTTP status should be 200")
class TestSigfoxContractEndpoints(unittest.TestCase):
def test_get_contract_information(self):
status, _ = sigfox.get_contract_information()
self.assertEqual(status, 200, "HTTP status should be 200")
class TestSigfoxDeviceTypeCallback(unittest.TestCase):
def test_device_type_list(self):
status, _ = sigfox.get_device_type_list()
self.assertEqual(status, 200, "HTTP status should be 200")
if __name__ == "__main__":
unittest.main()