File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,10 @@ def main():
412412 validate_args (args )
413413
414414 if args .logs :
415- host = HostFromLogs (args .logs )
415+ if ".tar" in args .logs :
416+ host = HostFromTarball (args .logs )
417+ else :
418+ host = HostFromLogs (args .logs )
416419 else :
417420 host = Host (args .machine , args .username , args .password )
418421
Original file line number Diff line number Diff line change @@ -402,6 +402,14 @@ def test_validate_local_machine(self):
402402 args .password = None
403403 inspector .validate_args (args )
404404
405+ @patch ('hwinfo.tools.inspector.print_system_info' )
406+ @patch ('hwinfo.tools.inspector.HostFromTarball' )
407+ def test_from_tarball (self , host_cls , print_system_info ):
408+ sys .argv = ['hwinfo' , '-l' , 'ack-submission.tar.gz' ]
409+ mhost = host_cls .return_value = mock .MagicMock ()
410+ inspector .main ()
411+ host_cls .assert_called_with ('ack-submission.tar.gz' )
412+
405413class PrintSystemInfoTests (unittest .TestCase ):
406414
407415 @patch ('hwinfo.tools.inspector.print_unit' )
You can’t perform that action at this time.
0 commit comments