Skip to content

Commit

Permalink
Move tests directory to src/
Browse files Browse the repository at this point in the history
  • Loading branch information
ZJaume committed Mar 14, 2023
1 parent a44b2c2 commit 28de19c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
**.swp

# Test output files
tests/output_test_dedup.txt
tests/output_test_aggr_dedup.txt
src/tests/output_test_dedup.txt
src/tests/output_test_aggr_dedup.txt

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pip install .
Automatic testing was added to ensure that everything is working fine in Bifixer:

```bash
cd bifixer/tests
cd bifixer
pytest
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions tests/test_bifixer.py → src/tests/test_bifixer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ class TestEmptySpaces():
args.header = None
args.ignore_empty = False
args.ignore_long = False
args.input = open("tests/input_test_1.txt", "rt")
args.input = open("src/tests/input_test_1.txt", "rt")
args.dedup = False
args.output = open("tests/output_test_1.txt", "w+")
args.output = open("src/tests/output_test_1.txt", "w+")
args.ignore_html = False
args.annotated_output = False

def test__empty(self):
bifixer.fix_sentences(self.args)
self.args.output.close()

with open("tests/output_expected_1.txt", "rt") as expected, open("tests/output_test_1.txt", "rt") as test:
with open("src/tests/output_expected_1.txt", "rt") as expected, open("src/tests/output_test_1.txt", "rt") as test:
for e, t in zip(expected, test):
assert e == t

Expand Down Expand Up @@ -218,8 +218,8 @@ class TestDedup:
args.tparagraphid = None
args.header = None
args.aggressive_dedup = False
args.input = open("tests/input_test_2.txt", "rt")
args.output = open("tests/output_test_dedup.txt", "w+")
args.input = open("src/tests/input_test_2.txt", "rt")
args.output = open("src/tests/output_test_dedup.txt", "w+")
args.ignore_html = False
args.annotated_output = False

Expand All @@ -228,7 +228,7 @@ def test_aggressive_dedup(self):
self.args.input.close()
self.args.output.close()

with open("tests/output_test_dedup.txt") as file_:
with open("src/tests/output_test_dedup.txt") as file_:
hashes = []
for line in file_:
parts = line.rstrip("\n").split("\t")
Expand Down Expand Up @@ -260,8 +260,8 @@ class TestAggressiveDedup:
args.tparagraphid = None
args.header = None
args.aggressive_dedup = True
args.input = open("tests/input_test_2.txt", "rt")
args.output = open("tests/output_test_aggr_dedup.txt", "w+")
args.input = open("src/tests/input_test_2.txt", "rt")
args.output = open("src/tests/output_test_aggr_dedup.txt", "w+")
args.ignore_html = False
args.annotated_output = False

Expand All @@ -270,7 +270,7 @@ def test_aggressive_dedup(self):
self.args.input.close()
self.args.output.close()

with open("tests/output_test_aggr_dedup.txt") as file_:
with open("src/tests/output_test_aggr_dedup.txt") as file_:
hashes = []
for line in file_:
parts = line.rstrip("\n").split("\t")
Expand Down

0 comments on commit 28de19c

Please sign in to comment.