Skip to content

Commit

Permalink
fixed no-name-in-module
Browse files Browse the repository at this point in the history
  • Loading branch information
sjpark608 committed Dec 20, 2022
1 parent 23b2195 commit 7fb08ed
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/edgepi/calibration/edgepi_eeprom.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'''Helper class to access on board eeprom'''

# pylint: disable=no-name-in-module

import logging
import math

Expand Down
1 change: 1 addition & 0 deletions src/edgepi/calibration/protobuf_mapping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""module to map protobuf data to a class"""

# pylint: disable=no-name-in-module
from dataclasses import dataclass
from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout
from edgepi.calibration.calibration_constants import CalibParam
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'''unit test for access eeprom'''

# pylint: disable=C0413

# pylint: disable=no-name-in-module

from unittest import mock
import os
Expand Down Expand Up @@ -137,7 +137,7 @@ def test_get_message_of_interest(mocker, msg, eeprom):
tc_dict_hw = {0:1}


keys = '-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEAnwu+S/OI3Hl0BCNQASv0HU5Jc4KUT2X4/tLykG+T\
KEYS = '-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEAnwu+S/OI3Hl0BCNQASv0HU5Jc4KUT2X4/tLykG+T\
mZQcd6pE\r\nv7fji6ZoW/dl8dKwwdi/cfSS/J5Iv+5FwQU4KGNBbhVAnmJeLd+PMUT4bQTf9rVF\r\nHsDoIPoQLDH7jmBu8ai\
7jQ0hY5SqPbynPGELFrk/vEpHwg/8fO4lbw1YxwgGc0SR\r\n8k1tFdi4On7NymBiv88HOsrrziAPGCd7Hc07s+SdFQF+nDPidy\
M1pMqvUC25c5Sk\r\ncsrBlMgmcSRY8y6MJFPObg0ahLsI/YT+jT2G6AioQOz9ZJ89DSzjEfoFK9KlIzq1\r\n46THPR8Tdc9qu\
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_get_edgepi_reserved_data(mocker, eeprom):
assert eeprom_data.serial == '20221110-021'
assert eeprom_data.model == 'EdgePi-Bearbone'
assert eeprom_data.client_id == 'SO-2022-1023'
assert eeprom_data.config_key.certificate == keys
assert eeprom_data.config_key.private == keys
assert eeprom_data.data_key.certificate == keys
assert eeprom_data.data_key.certificate == keys
assert eeprom_data.config_key.certificate == KEYS
assert eeprom_data.config_key.private == KEYS
assert eeprom_data.data_key.certificate == KEYS
assert eeprom_data.data_key.certificate == KEYS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'''unit test for access eeprom'''
# pylint: disable=C0413
# pylint: disable=no-member
# pylint: disable=no-name-in-module
from unittest import mock
import os
PATH = os.path.dirname(os.path.abspath(__file__))
Expand Down Expand Up @@ -46,7 +47,7 @@ def read_binfile():
tc_dict_hw = {0:1}


keys = '-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEAnwu+S/OI3Hl0BCNQASv0HU5Jc4KUT2X4/tLykG+T\
KEYS = '-----BEGIN RSA PRIVATE KEY-----\r\nMIIEpQIBAAKCAQEAnwu+S/OI3Hl0BCNQASv0HU5Jc4KUT2X4/tLykG+T\
mZQcd6pE\r\nv7fji6ZoW/dl8dKwwdi/cfSS/J5Iv+5FwQU4KGNBbhVAnmJeLd+PMUT4bQTf9rVF\r\nHsDoIPoQLDH7jmBu8ai\
7jQ0hY5SqPbynPGELFrk/vEpHwg/8fO4lbw1YxwgGc0SR\r\n8k1tFdi4On7NymBiv88HOsrrziAPGCd7Hc07s+SdFQF+nDPidy\
M1pMqvUC25c5Sk\r\ncsrBlMgmcSRY8y6MJFPObg0ahLsI/YT+jT2G6AioQOz9ZJ89DSzjEfoFK9KlIzq1\r\n46THPR8Tdc9qu\
Expand Down Expand Up @@ -88,7 +89,7 @@ def test_edgepi_eeprom_data():
assert eeprom_data.serial == '20221110-021'
assert eeprom_data.model == 'EdgePi-Bearbone'
assert eeprom_data.client_id == 'SO-2022-1023'
assert eeprom_data.config_key.certificate == keys
assert eeprom_data.config_key.private == keys
assert eeprom_data.data_key.certificate == keys
assert eeprom_data.data_key.certificate == keys
assert eeprom_data.config_key.certificate == KEYS
assert eeprom_data.config_key.private == KEYS
assert eeprom_data.data_key.certificate == KEYS
assert eeprom_data.data_key.certificate == KEYS
3 changes: 2 additions & 1 deletion src/test_edgepi/unit_tests/test_dac/test_edgepi_dac.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
sys.modules['periphery'] = mock.MagicMock()

# pylint: disable=wrong-import-position
# pylint: disable=no-name-in-module
# pylint: disable=protected-access

import pytest
Expand All @@ -21,8 +22,8 @@
from edgepi.dac.edgepi_dac import EdgePiDAC
from edgepi.calibration.calibration_constants import CalibParam
from edgepi.calibration.protobuf_mapping import EdgePiEEPROMData
from test_edgepi.unit_tests.test_calibration.read_serialized import read_binfile
from edgepi.calibration.eeprom_mapping_pb2 import EepromLayout
from test_edgepi.unit_tests.test_calibration.read_serialized import read_binfile

dummy_calib_param_dict = {0:CalibParam(gain=1,offset=0),
1:CalibParam(gain=1,offset=0),
Expand Down

0 comments on commit 7fb08ed

Please sign in to comment.