mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2026-04-26 21:04:16 +02:00
initial add du parser
This commit is contained in:
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+5199
File diff suppressed because it is too large
Load Diff
Vendored
+3364
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
import os
|
||||
import json
|
||||
import unittest
|
||||
import jc.parsers.du
|
||||
|
||||
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# input
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/du.out'), 'r') as f:
|
||||
self.centos_7_7_du = f.read()
|
||||
|
||||
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/du.out'), 'r') as f:
|
||||
# self.ubuntu_18_4_du = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/du.json'), 'r') as f:
|
||||
self.centos_7_7_du_json = json.loads(f.read())
|
||||
|
||||
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/du.json'), 'r') as f:
|
||||
# self.ubuntu_18_4_du_json = json.loads(f.read())
|
||||
|
||||
def test_du_centos_7_7(self):
|
||||
"""
|
||||
Test 'du' on Centos 7.7
|
||||
"""
|
||||
self.assertEqual(jc.parsers.du.parse(self.centos_7_7_du, quiet=True), self.centos_7_7_du_json)
|
||||
|
||||
# def test_du_ubuntu_18_4(self):
|
||||
# """
|
||||
# Test 'du' on Ubuntu 18.4
|
||||
# """
|
||||
# self.assertEqual(jc.parsers.du.parse(self.ubuntu_18_4_du, quiet=True), self.ubuntu_18_4_du_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user