def test_is_sata30orless_sata30(self, mock_subprocess_check_output): extcmd_output = (b'supressed text\nSATA Version is: ' b'SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)\n' b'supressed text\n\n') mock_subprocess_check_output.return_value = extcmd_output ret = utils.is_sata30orless('/dev/sda') mock_subprocess_check_output.assert_called() self.assertEqual(ret, True)