Beispiel #1
0
    def testunit_get_self_stats(self):
        test_stat_path = os.path.join(self._testdata_dir, 'proc_pid_stat')

        stats = mlab.get_self_stats(test_stat_path)

        self.assertEqual(stats['stime'], 1503.0)
        self.assertEqual(stats['utime'], 255.0)
        self.assertEqual(stats['vsize'], 1234321)
Beispiel #2
0
  def testunit_get_self_stats(self):
    test_stat_path = os.path.join(self._testdata_dir, 'proc_pid_stat')

    stats = mlab.get_self_stats(test_stat_path)

    self.assertEqual(stats['stime'], 1503.0)
    self.assertEqual(stats['utime'], 255.0)
    self.assertEqual(stats['vsize'], 1234321)
Beispiel #3
0
    def testunit_get_self_stats_WHEN_bad_stat_data(self):
        test_stat_path = os.path.join(self._testdata_dir, 'stat_wrong')

        stats = mlab.get_self_stats(test_stat_path)

        self.assertDictEqual(stats, {})
Beispiel #4
0
    def testunit_get_self_stats_WHEN_no_stat_file(self):
        test_stat_path = os.path.join(self._testdata_dir, 'no_stat')

        stats = mlab.get_self_stats(test_stat_path)

        self.assertDictEqual(stats, {})
Beispiel #5
0
  def testunit_get_self_stats_WHEN_bad_stat_data(self):
    test_stat_path = os.path.join(self._testdata_dir, 'stat_wrong')

    stats = mlab.get_self_stats(test_stat_path)

    self.assertDictEqual(stats, {})
Beispiel #6
0
  def testunit_get_self_stats_WHEN_no_stat_file(self):
    test_stat_path = os.path.join(self._testdata_dir, 'no_stat')

    stats = mlab.get_self_stats(test_stat_path)

    self.assertDictEqual(stats, {})