Compare commits
3 Commits
56b9741e21
...
55b87f429d
Author | SHA1 | Date | |
---|---|---|---|
|
55b87f429d | ||
|
9b9fb0acac | ||
|
55c4499099 |
@@ -36,11 +36,28 @@ class ddOperApiTest(unittest.TestCase):
|
|||||||
self.assertEqual(type(locations), ddOperApi.ddOperLocation)
|
self.assertEqual(type(locations), ddOperApi.ddOperLocation)
|
||||||
self.assertTrue(len(locations.data) > 0)
|
self.assertTrue(len(locations.data) > 0)
|
||||||
self.assertEqual(type(locations.data[0]["properties"]["locationName"]), str)
|
self.assertEqual(type(locations.data[0]["properties"]["locationName"]), str)
|
||||||
|
|
||||||
|
def test_locationNames(self):
|
||||||
|
names = self.client.locations().locationNames()
|
||||||
|
self.assertEqual(type(names), type({}.keys()))
|
||||||
|
self.assertTrue(len(names) > 0)
|
||||||
|
for n in names:
|
||||||
|
self.assertEqual(type(n), str)
|
||||||
|
|
||||||
|
def test_locationDetail(self):
|
||||||
|
locations = self.client.locations()
|
||||||
|
name = locations.data[0]["properties"]["locationName"]
|
||||||
|
detail = locations.locationDetail(name)
|
||||||
|
self.assertEqual(type(detail), dict)
|
||||||
|
self.assertEqual(detail["properties"]["locationName"], name)
|
||||||
|
|
||||||
def test_quantities(self):
|
def test_quantities(self):
|
||||||
quantities = self.client.quantities()
|
quantities = self.client.quantities()
|
||||||
self.assertEqual(type(quantities), ddOperApi.ddOperQuantitie)
|
self.assertEqual(type(quantities), ddOperApi.ddOperQuantitie)
|
||||||
self.assertTrue(len(quantities.data) > 0)
|
self.assertTrue(len(quantities.data) > 0)
|
||||||
self.assertEqual(type(quantities.data[0]), str)
|
self.assertEqual(type(quantities.data[0]), str)
|
||||||
|
for q in quantities.quantities():
|
||||||
|
self.assertEqual(type(q), str)
|
||||||
|
|
||||||
def test_values(self):
|
def test_values(self):
|
||||||
values = self.client.values("test1", "null")
|
values = self.client.values("test1", "null")
|
||||||
|
@@ -20,12 +20,9 @@ from flask import Flask, request
|
|||||||
#
|
#
|
||||||
|
|
||||||
class testServer(Flask):
|
class testServer(Flask):
|
||||||
def __init__(self, name):
|
def run(self):
|
||||||
super().__init__(__name__)
|
|
||||||
self.createCert()
|
self.createCert()
|
||||||
self.writeCert()
|
self.writeCert()
|
||||||
|
|
||||||
def run(self):
|
|
||||||
super().run(ssl_context=(self.certFile.name, self.keyFile.name))
|
super().run(ssl_context=(self.certFile.name, self.keyFile.name))
|
||||||
|
|
||||||
def createCert(self):
|
def createCert(self):
|
||||||
@@ -232,7 +229,7 @@ def forkTestServer():
|
|||||||
if (pid == 0):
|
if (pid == 0):
|
||||||
app.run()
|
app.run()
|
||||||
else:
|
else:
|
||||||
sleep(0.01)
|
sleep(0.1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise(e)
|
raise(e)
|
||||||
return(pid)
|
return(pid)
|
||||||
|
Reference in New Issue
Block a user