# Path: amonagent/modules/core.py
# def get_cpu_info():
# def get_ip_address():	
# def get_uptime():
# def get_memory_info():
# 	def parse_output(self, df_output):
# 		def keep_device(device):
# 	def _is_number(self, a_string):
# 	def _check_blocks(self, blocks):
# 	def _is_real_device(self, device):
# 	def _flatten_devices(self, devices):
# 	def check(self):
# def get_network_traffic():
# def get_load_average():
# def get_cpu_utilization():
# 	MINUTE  = 60
# 	HOUR    = MINUTE * 60
# 	DAY     = HOUR * 24
# class DiskCheck(object):


import sys
import re
import socket
from amonagent.modules.core import (
	get_uptime,
	get_memory_info,
	get_cpu_utilization,
	get_load_average,
	get_network_traffic,
	get_ip_address,
	get_cpu_info, 
	disk_check
)

	def test_disk(self):
		disk = disk_check.check()

		for k in disk:
			_dict = disk[k]

			assert 'used' in _dict
			assert 'percent' in _dict
			assert 'free' in _dict
			assert 'volume' in _dict
			assert 'total' in _dict


	def test_cpu(self):
		cpu = get_cpu_utilization()

		assert 'idle' in cpu
		assert 'user' in cpu
		assert 'system' in cpu

		for v in cpu.values():
			# Could be 1.10 - 4, 10.10 - 5, 100.00 - 6
			assert len(v) == 4 or len(v) == 5 or len(v) == 6

			value_regex = re.compile(r'\d+[\.]\d+')
			assert re.match(value_regex, v)


	def test_loadavg(self):

# Path: amonagent/modules/core.py
# def get_cpu_info():
# def get_ip_address():	
# def get_uptime():
# def get_memory_info():
# 	def parse_output(self, df_output):
# 		def keep_device(device):
# 	def _is_number(self, a_string):
# 	def _check_blocks(self, blocks):
# 	def _is_real_device(self, device):
# 	def _flatten_devices(self, devices):
# 	def check(self):
# def get_network_traffic():
# def get_load_average():
# def get_cpu_utilization():
# 	MINUTE  = 60
# 	HOUR    = MINUTE * 60
# 	DAY     = HOUR * 24
# class DiskCheck(object):


# Path: tests/modules_core_test.py
import sys
import re
import socket
from amonagent.modules.core import (
	get_uptime,
	get_memory_info,
	get_cpu_utilization,
	get_load_average,
	get_network_traffic,
	get_ip_address,
	get_cpu_info, 
	disk_check
)


	def test_disk(self):
		disk = disk_check.check()

		for k in disk:
			_dict = disk[k]

			assert 'used' in _dict
			assert 'percent' in _dict
			assert 'free' in _dict
			assert 'volume' in _dict
			assert 'total' in _dict


	def test_cpu(self):
		cpu = get_cpu_utilization()

		assert 'idle' in cpu
		assert 'user' in cpu
		assert 'system' in cpu

		for v in cpu.values():
			# Could be 1.10 - 4, 10.10 - 5, 100.00 - 6
			assert len(v) == 4 or len(v) == 5 or len(v) == 6

			value_regex = re.compile(r'\d+[\.]\d+')
			assert re.match(value_regex, v)


	def test_loadavg(self):

		loadavg = get_load_average()