26 lines
552 B
Python
26 lines
552 B
Python
import unittest
|
|
|
|
from app.App import App
|
|
|
|
|
|
class test_SystemService(unittest.TestCase):
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
App.init()
|
|
|
|
def test_getIp(self):
|
|
ip = App.services.systemService.getIp()
|
|
self.assertGreater(len(ip), 8)
|
|
self.assertEqual(ip.count('.'), 3)
|
|
|
|
def test_getRam(self):
|
|
ram = App.services.systemService.getRamMbAvailable()
|
|
self.assertGreater(ram, 0)
|
|
self.assertLess(ram, 1000000)
|
|
|
|
def test_getCpu(self):
|
|
cpu = App.services.systemService.getCpuUtilization()
|
|
self.assertGreater(cpu, 0)
|
|
self.assertLess(cpu, 100)
|