-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add `inplace` flag to CLI * inplace flag added to function signatures + docstring updated * `inplace` testcases added + tiny refactorings * CHANGELOG.md updated * `inplace` CLI testcases added * add `in_place` in readme + it's examples * `CHANGELOG.md` updated * `README.md` updated * help param of `--inplace` updated * docstring of `in_place` param updated
- Loading branch information
Showing
6 changed files
with
95 additions
and
37 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
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 |
---|---|---|
@@ -1,25 +1,47 @@ | ||
from dmeta.functions import update, update_all, clear, clear_all | ||
import os | ||
from dmeta.functions import update, update_all, clear, clear_all | ||
|
||
TESTS_DIR_PATH = os.path.join(os.getcwd(), "tests") | ||
|
||
def test_clear(): | ||
# check the clearance | ||
def test1(): | ||
# clear a single .docx file [not inplace] | ||
clear(os.path.join(TESTS_DIR_PATH, "test_a.docx")) | ||
|
||
|
||
def test_clear_all(): | ||
# check all files clearance | ||
def test2(): | ||
# clear a single .docx file [inplace] | ||
clear(os.path.join(TESTS_DIR_PATH, "test_a.docx"), in_place=True) | ||
|
||
|
||
def test3(): | ||
# clear all existing .docx files [not inplace] | ||
os.chdir(TESTS_DIR_PATH) | ||
clear_all() | ||
|
||
|
||
def test_update(): | ||
# test meta-data is updated | ||
def test4(): | ||
# clear all existing .docx files [inplace] | ||
os.chdir(TESTS_DIR_PATH) | ||
clear_all(in_place=True) | ||
|
||
|
||
def test5(): | ||
# update a single .docx file [not inplace] | ||
update(os.path.join(TESTS_DIR_PATH, "config.json"), os.path.join(TESTS_DIR_PATH, "test_a.docx")) | ||
|
||
|
||
def test_update_all(): | ||
# test all files meta-data are updated | ||
def test6(): | ||
# update a single .docx file [inplace] | ||
update(os.path.join(TESTS_DIR_PATH, "config.json"), os.path.join(TESTS_DIR_PATH, "test_a.docx"), in_place=True) | ||
|
||
|
||
def test7(): | ||
# update all existing .docx files [not inplace] | ||
os.chdir(TESTS_DIR_PATH) | ||
update_all(os.path.join(TESTS_DIR_PATH, "config.json")) | ||
|
||
|
||
def test8(): | ||
# update all existing .docx files [inplace] | ||
os.chdir(TESTS_DIR_PATH) | ||
update_all(os.path.join(TESTS_DIR_PATH, "config.json"), in_place=True) |