1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests the process information."""
import os
import unittest
from plaso.engine import process_info
class ProcessInfoTest(unittest.TestCase):
"""Tests the process information."""
def testInitialization(self):
"""Tests the __init__ function."""
pid = os.getpid()
process_information = process_info.ProcessInfo(pid)
self.assertIsNotNone(process_information)
with self.assertRaises(IOError):
process_info.ProcessInfo(-1)
def testGetUsedMemory(self):
"""Tests the GetUsedMemory function."""
pid = os.getpid()
process_information = process_info.ProcessInfo(pid)
used_memory = process_information.GetUsedMemory()
self.assertIsNotNone(used_memory)
if __name__ == '__main__':
unittest.main()
|