summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-03-01 14:06:59 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-03-01 14:06:59 +0100
commitd7d1110a5bb908632733ca8268327f23732f26a8 (patch)
treefc85d6d5781f28247083745221c145fa4e9e27dd /test
parent4516319ff93c65650dade21a34f33fb7e9f8b96c (diff)
Update tests
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_ptamodel.py15
-rwxr-xr-xtest/test_timingharness.py23
2 files changed, 20 insertions, 18 deletions
diff --git a/test/test_ptamodel.py b/test/test_ptamodel.py
index f8c065b..a8fc89f 100755
--- a/test/test_ptamodel.py
+++ b/test/test_ptamodel.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+from dfatool.functions import StaticInfo
from dfatool.loader import RawData, pta_trace_to_aggregate
from dfatool.model import PTAModel
from dfatool.utils import by_name_to_by_param
@@ -638,7 +639,7 @@ class TestFromFile(unittest.TestCase):
)
param_model, param_info = model.get_fitted()
- self.assertEqual(param_info("POWERDOWN", "power"), None)
+ self.assertIsInstance(param_info("POWERDOWN", "power"), StaticInfo)
self.assertEqual(
param_info("RX", "power").function.model_function,
"0 + regression_arg(0) + regression_arg(1) * np.sqrt(parameter(datarate))",
@@ -649,7 +650,7 @@ class TestFromFile(unittest.TestCase):
self.assertAlmostEqual(
param_info("RX", "power").function.model_args[1], 117, places=0
)
- self.assertEqual(param_info("STANDBY1", "power"), None)
+ self.assertIsInstance(param_info("STANDBY1", "power"), StaticInfo)
self.assertEqual(
param_info("TX", "power").function.model_function,
"0 + regression_arg(0) + regression_arg(1) * 1/(parameter(datarate)) + regression_arg(2) * parameter(txpower) + regression_arg(3) * 1/(parameter(datarate)) * parameter(txpower)",
@@ -1823,15 +1824,15 @@ class TestFromFile(unittest.TestCase):
"""
param_model, param_info = model.get_fitted()
- self.assertEqual(param_info("IDLE", "power"), None)
+ self.assertIsInstance(param_info("IDLE", "power"), StaticInfo)
self.assertEqual(
param_info("RX", "power").function.model_function,
"0 + regression_arg(0) + regression_arg(1) * np.log(parameter(symbolrate) + 1)",
)
- self.assertEqual(param_info("SLEEP", "power"), None)
- self.assertEqual(param_info("SLEEP_EWOR", "power"), None)
- self.assertEqual(param_info("SYNTH_ON", "power"), None)
- self.assertEqual(param_info("XOFF", "power"), None)
+ self.assertIsInstance(param_info("SLEEP", "power"), StaticInfo)
+ self.assertIsInstance(param_info("SLEEP_EWOR", "power"), StaticInfo)
+ self.assertIsInstance(param_info("SYNTH_ON", "power"), StaticInfo)
+ self.assertIsInstance(param_info("XOFF", "power"), StaticInfo)
self.assertAlmostEqual(
param_info("RX", "power").function.model_args[0], 84415, places=0
diff --git a/test/test_timingharness.py b/test/test_timingharness.py
index 5cc0bec..8c68e4a 100755
--- a/test/test_timingharness.py
+++ b/test/test_timingharness.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+from dfatool.functions import StaticInfo
from dfatool.loader import TimingData, pta_trace_to_aggregate
from dfatool.model import AnalyticModel
from dfatool.parameters import prune_dependent_parameters
@@ -30,9 +31,9 @@ class TestModels(unittest.TestCase):
)
param_model, param_info = model.get_fitted()
- self.assertEqual(param_info("setPALevel", "duration"), None)
- self.assertEqual(param_info("setRetries", "duration"), None)
- self.assertEqual(param_info("setup", "duration"), None)
+ self.assertIsInstance(param_info("setPALevel", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setRetries", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setup", "duration"), StaticInfo)
self.assertEqual(
param_info("write", "duration").function.model_function,
"0 + regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * parameter(max_retry_count) * parameter(retry_delay)",
@@ -77,10 +78,10 @@ class TestModels(unittest.TestCase):
)
param_model, param_info = model.get_fitted()
- self.assertEqual(param_info("getObserveTx", "duration"), None)
- self.assertEqual(param_info("setPALevel", "duration"), None)
- self.assertEqual(param_info("setRetries", "duration"), None)
- self.assertEqual(param_info("setup", "duration"), None)
+ self.assertIsInstance(param_info("getObserveTx", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setPALevel", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setRetries", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setup", "duration"), StaticInfo)
self.assertEqual(
param_info("write", "duration").function.model_function,
"0 + regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * parameter(max_retry_count) * parameter(retry_delay)",
@@ -135,10 +136,10 @@ class TestModels(unittest.TestCase):
)
param_model, param_info = model.get_fitted()
- self.assertEqual(param_info("setAutoAck", "duration"), None)
- self.assertEqual(param_info("setPALevel", "duration"), None)
- self.assertEqual(param_info("setRetries", "duration"), None)
- self.assertEqual(param_info("setup", "duration"), None)
+ self.assertIsInstance(param_info("setAutoAck", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setPALevel", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setRetries", "duration"), StaticInfo)
+ self.assertIsInstance(param_info("setup", "duration"), StaticInfo)
self.assertEqual(
param_info("write", "duration").function.model_function,
"(parameter(auto_ack!) * (regression_arg(0) + regression_arg(1) * parameter(max_retry_count) + regression_arg(2) * parameter(retry_delay) + regression_arg(3) * parameter(max_retry_count) * parameter(retry_delay))) + ((1 - parameter(auto_ack!)) * regression_arg(4))",