mirror of https://github.com/1okko/openpilot.git
update param in loggerd unit test
This commit is contained in:
parent
7ce29ef08e
commit
5f1e7649e3
|
@ -116,7 +116,7 @@ class TestLoggerd(unittest.TestCase):
|
|||
params.clear_all()
|
||||
for k, _, v in fake_params:
|
||||
params.put(k, v)
|
||||
params.put("LaikadEphemerisV3", "abc")
|
||||
params.put("AccessToken", "abc")
|
||||
|
||||
lr = list(LogReader(str(self._gen_bootlog())))
|
||||
initData = lr[0].initData
|
||||
|
@ -133,14 +133,14 @@ class TestLoggerd(unittest.TestCase):
|
|||
|
||||
# check params
|
||||
logged_params = {entry.key: entry.value for entry in initData.params.entries}
|
||||
expected_params = {k for k, _, __ in fake_params} | {'LaikadEphemerisV3'}
|
||||
expected_params = {k for k, _, __ in fake_params} | {'AccessToken'}
|
||||
assert set(logged_params.keys()) == expected_params, set(logged_params.keys()) ^ expected_params
|
||||
assert logged_params['LaikadEphemerisV3'] == b'', f"DONT_LOG param value was logged: {repr(logged_params['LaikadEphemerisV3'])}"
|
||||
assert logged_params['AccessToken'] == b'', f"DONT_LOG param value was logged: {repr(logged_params['AccessToken'])}"
|
||||
for param_key, initData_key, v in fake_params:
|
||||
self.assertEqual(getattr(initData, initData_key), v)
|
||||
self.assertEqual(logged_params[param_key].decode(), v)
|
||||
|
||||
params.put("LaikadEphemerisV3", "")
|
||||
params.put("AccessToken", "")
|
||||
|
||||
def test_rotation(self):
|
||||
os.environ["LOGGERD_TEST"] = "1"
|
||||
|
|
Loading…
Reference in New Issue