Skip to content

Commit

Permalink
Update test_get_serial_number.py
Browse files Browse the repository at this point in the history
  • Loading branch information
shawaj authored Jul 2, 2023
1 parent f1b2b41 commit 5f82ec4
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions hw_diag/tests/test_get_serial_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,3 @@ def test_has_valid_serial_called(self, mock_valid_serial, mock_serial, mock_cpui

get_serial_number(self.diag)
mock_valid_serial.assert_called_once()

@patch('hw_diag.utilities.hardware.is_rockpi')
@patch('hw_diag.utilities.hardware.load_cpu_info')
@patch('hw_diag.utilities.hardware.load_serial_number')
@patch('hw_diag.utilities.hardware.has_valid_serial')
def test_has_valid_serial_called_twice(self, mock_valid_serial, mock_serial, mock_cpuinfo, mock_rockpi):
mock_rockpi.return_value = True
mock_cpuinfo.return_value = {'serial': TEST_SERIAL_ALL_ZERO}
mock_serial.return_value = {'serial': TEST_SERIAL_SHORT}

get_serial_number(self.diag)
assertEqual(mock_valid_serial.call_count, 2)

0 comments on commit 5f82ec4

Please sign in to comment.