TestServerMonitor.py 613 B

12345678910111213141516171819
  1. from __future__ import division
  2. import unittest
  3. from monitor import Env, DetailProcess
  4. class TestMonitorServer(unittest.TestCase):
  5. def test_Environment(self):
  6. """
  7. This test case is designed to test the existance of a resource set as an environment variable. This applies to files, folders (not values)
  8. """
  9. p = Env(['PATH','HOME','SHELL'])
  10. value = p.composite()
  11. self.assertTrue(value > 0 and value == 2/3)
  12. self.assertTrue(p.evaluate('PATH') == 0)
  13. def test_RunningProcess(self):
  14. p = DetailProcess(['rabbitmq-server','python'])
  15. print p.composite()
  16. if __name__ == '__main__' :
  17. unittest.main()