File: process_info.py

package info (click to toggle)
plaso 20201007-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 519,924 kB
  • sloc: python: 79,002; sh: 629; xml: 72; sql: 14; vhdl: 11; makefile: 10
file content (35 lines) | stat: -rw-r--r-- 837 bytes parent folder | download
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
34
35
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests the process information."""

from __future__ import unicode_literals

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()