Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenghaoMou committed Feb 25, 2024
1 parent e6f6293 commit 79ebd3e
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,4 @@ output
**/*parquet
**/checkpoints
*code-workspace
.ruff_cache
42 changes: 26 additions & 16 deletions cobertura.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<coverage version="7.4.3" timestamp="1708808380781" lines-valid="602" lines-covered="450" line-rate="0.7475" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<coverage version="7.4.3" timestamp="1708858280150" lines-valid="612" lines-covered="460" line-rate="0.7516" branches-covered="0" branches-valid="0" branch-rate="0" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.4.3 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
Expand All @@ -12,45 +12,55 @@
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="26" hits="1"/>
<line number="30" hits="1"/>
<line number="35" hits="1"/>
<line number="36" hits="1"/>
</lines>
</class>
<class name="test_exact_hash.py" filename="tests/test_exact_hash.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="26" hits="1"/>
<line number="30" hits="1"/>
<line number="35" hits="1"/>
<line number="36" hits="1"/>
</lines>
</class>
<class name="test_minhash.py" filename="tests/test_minhash.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="26" hits="1"/>
<line number="30" hits="1"/>
<line number="35" hits="1"/>
<line number="36" hits="1"/>
</lines>
</class>
<class name="test_simhash.py" filename="tests/test_simhash.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="26" hits="1"/>
<line number="30" hits="1"/>
<line number="35" hits="1"/>
<line number="36" hits="1"/>
</lines>
</class>
<class name="test_suffix_array.py" filename="tests/test_suffix_array.py" complexity="0" line-rate="1" branch-rate="0">
<methods/>
<lines>
<line number="1" hits="1"/>
<line number="3" hits="1"/>
<line number="4" hits="1"/>
<line number="5" hits="1"/>
<line number="26" hits="1"/>
<line number="30" hits="1"/>
<line number="36" hits="1"/>
<line number="37" hits="1"/>
</lines>
</class>
</classes>
Expand Down Expand Up @@ -184,12 +194,12 @@
<line number="41" hits="1"/>
<line number="101" hits="1"/>
<line number="104" hits="1"/>
<line number="108" hits="1"/>
<line number="112" hits="1"/>
<line number="109" hits="1"/>
<line number="115" hits="1"/>
<line number="116" hits="1"/>
<line number="120" hits="1"/>
<line number="121" hits="1"/>
<line number="118" hits="1"/>
<line number="119" hits="1"/>
<line number="123" hits="1"/>
<line number="126" hits="1"/>
</lines>
</class>
<class name="simhash.py" filename="text_dedup/simhash.py" complexity="0" line-rate="0.6347" branch-rate="0">
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
sys.path.insert(0, os.path.abspath("../.."))

project = "text-dedup"
copyright = "2023, Chenghao Mou"
copyright = "Apache 2.0"
author = "Chenghao Mou"

# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions tests/test_bloom_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ def test_bloom_filter():
assert (
"88803" in result.stdout and "47049" in result.stdout
), f"Expected before and after are not present in the output: {result.stdout}"

# remove the output and input
subprocess.run(["rm", "-rf", ".cache"])
subprocess.run(["rm", "-rf", ".temp-output"])
4 changes: 4 additions & 0 deletions tests/test_exact_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ def test_exact_hash():
assert (
"88803" in result.stdout and "47049" in result.stdout
), f"Expected before and after are not present in the output: {result.stdout}"

# remove the output and input
subprocess.run(["rm", "-rf", ".cache"])
subprocess.run(["rm", "-rf", ".temp-output"])
4 changes: 4 additions & 0 deletions tests/test_minhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ def test_minhash():
assert (
"88803" in result.stdout and "44092" in result.stdout
), f"Expected before and after are not present in the output: {result.stdout}"

# remove the output and input
subprocess.run(["rm", "-rf", ".cache"])
subprocess.run(["rm", "-rf", ".temp-output"])
4 changes: 4 additions & 0 deletions tests/test_simhash.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ def test_simhash():
assert (
"88803" in result.stdout and "45589" in result.stdout
), f"Expected before and after are not present in the output: {result.stdout}"

# remove the output and input
subprocess.run(["rm", "-rf", ".cache"])
subprocess.run(["rm", "-rf", ".temp-output"])
4 changes: 4 additions & 0 deletions tests/test_suffix_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ def test_suffix_array():
"180332342 bytes (88803)" in result.stdout
and "51305898 bytes (29254)" in result.stdout
), f"Expected before and after are not present in the output: {result.stdout}"

# remove the output and input
subprocess.run(["rm", "-rf", ".cache"])
subprocess.run(["rm", "-rf", ".temp-output"])

0 comments on commit 79ebd3e

Please sign in to comment.