-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
759 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ ext/ | |
.ymltoxml.y* | ||
.yasort.y* | ||
.yagrep.y* | ||
.oscal.y* | ||
in.* | ||
out.* | ||
sorted-out/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
Simple consumer test. | ||
""" | ||
|
||
from ymltoxml.utils import text_data_writer, text_file_reader | ||
|
||
OPTS = { | ||
'file_encoding': 'utf-8', | ||
'output_format': 'csv', | ||
} | ||
|
||
|
||
# read in some json "column data" | ||
data = text_file_reader('tests/data/catalog.json', OPTS) | ||
# spit out CSV records | ||
ret = text_data_writer(data, OPTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Simple consumer test. | ||
""" | ||
|
||
from natsort import os_sorted | ||
|
||
from ymltoxml.templates import xform_id | ||
from ymltoxml.utils import text_file_reader | ||
|
||
OPTS = { | ||
'file_encoding': 'utf-8', | ||
'output_format': 'raw', | ||
'default_csv_hdr': None, | ||
} | ||
|
||
# read in some json "column data" | ||
data = text_file_reader('tests/data/OE-expanded-profile-all-ids.txt', OPTS) | ||
if data[0].isupper(): | ||
lc_ids = [xform_id(x) for x in data] | ||
|
||
# spit out lowercase id format | ||
for ctl in os_sorted(lc_ids): | ||
print(ctl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
# comments should be preserved | ||
file_encoding: 'utf-8' | ||
default_ext: '.yaml' | ||
default_content_path: 'ext/oscal-content/nist.gov/SP800-53/rev5' | ||
default_profile_glob: '*resolved-profile_catalog.yaml' | ||
default_profile_name: 'PRIVACY' | ||
default_ssg_glob: 'nist_rhcos4.yml' | ||
default_ssg_path: 'ext/content/controls' | ||
default_lookup_key: 'controls' | ||
default_csv_hdr: null | ||
new_csv_hdrs: [] | ||
input_format: null | ||
output_format: 'json' | ||
preserve_quotes: true | ||
process_comments: false | ||
mapping: 4 | ||
sequence: 6 | ||
offset: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.