forked from elastic/anonymize-it
-
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
1 parent
7773a3b
commit fdacf88
Showing
16 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import collections | ||
|
||
|
||
def flatten(d, parent_key='', sep='.'): | ||
items = [] | ||
for k, v in d.items(): | ||
|
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
File renamed without changes.
Empty file.
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,14 @@ | ||
import sys | ||
import pytest | ||
|
||
|
||
def run_all(argv=None): | ||
if argv is None: | ||
argv = ['--cov', 'anonymize_it', '--verbose', '--junitxml', 'junit.xml', '--cov-report', 'xml'] | ||
else: | ||
argv = argv[1:] | ||
|
||
sys.exit(pytest.main(argv)) | ||
|
||
if __name__ == "__main__": | ||
run_all(sys.argv) |
Empty file.
Binary file not shown.
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,4 @@ | ||
from anonymize_it import readers | ||
|
||
def test_esreader(): | ||
pass |
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,17 @@ | ||
from anonymize_it import utils | ||
|
||
|
||
def test_flatten(): | ||
old = { | ||
"this": { | ||
"is": { | ||
"a": { | ||
"test": True | ||
} | ||
} | ||
} | ||
} | ||
|
||
flattened = utils.flatten(old) | ||
new = {"this.is.a.test": True} | ||
assert new == flattened |
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,27 @@ | ||
from anonymize_it import writers | ||
import json | ||
import os | ||
|
||
|
||
def test_fswriter(): | ||
params = { | ||
"directory": "test_output" | ||
} | ||
|
||
data = { | ||
"test": "this is a test".split() | ||
} | ||
|
||
fswriter = writers.FSWriter(params) | ||
fswriter.write_data(data) | ||
file_name = "test_output/output.json" | ||
with open(file_name, 'r') as f: | ||
in_data = json.load(f) | ||
|
||
os.remove(file_name) | ||
|
||
assert data == in_data | ||
|
||
|
||
def test_ESWriter(): | ||
pass |