You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.0 KiB
45 lines
1.0 KiB
#!/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())
|