#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2022/9/10 10:07 # @Author : old tom # @File : test_fu_sys.py # @Project : Futool from unittest import TestCase from futool.system import fu_sys # @Desc : class Test(TestCase): def test_is_windows(self): rt = fu_sys.is_windows() self.assertTrue(rt) def test_is_linux(self): rt = fu_sys.is_linux() self.assertFalse(rt) def test_is_unix(self): rt = fu_sys.is_unix() self.assertFalse(rt) def test_os_name(self): rt = fu_sys.os_name() self.assertIsNotNone(rt) def test_host_name(self): rt = fu_sys.host_name() self.assertIsNotNone(rt) def test_sys_user(self): rt = fu_sys.sys_user() self.assertIsNotNone(rt) def test_sys_user_dir(self): rt = fu_sys.sys_user_dir() self.assertIsNotNone(rt) def test_cpu_info(self): cpu_info = fu_sys.CpuInfo() self.assertIsNotNone(cpu_info.cpu_count()) self.assertIsNotNone(cpu_info.cpu_architecture())