From 79ebd3e236fb442348760396077ab4420e188071 Mon Sep 17 00:00:00 2001 From: Chenghao Mou Date: Sun, 25 Feb 2024 10:57:52 +0000 Subject: [PATCH] update tests --- .gitignore | 1 + cobertura.xml | 42 +++++++++++++++++++++++--------------- docs/source/conf.py | 2 +- tests/test_bloom_filter.py | 4 ++++ tests/test_exact_hash.py | 4 ++++ tests/test_minhash.py | 4 ++++ tests/test_simhash.py | 4 ++++ tests/test_suffix_array.py | 4 ++++ 8 files changed, 48 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 6dcab71..a8cf98b 100644 --- a/.gitignore +++ b/.gitignore @@ -159,3 +159,4 @@ output **/*parquet **/checkpoints *code-workspace +.ruff_cache diff --git a/cobertura.xml b/cobertura.xml index d7418f8..2e92f2a 100644 --- a/cobertura.xml +++ b/cobertura.xml @@ -1,5 +1,5 @@ - + @@ -12,45 +12,55 @@ - + - + + + - + - + + + - + - + + + - + - + + + - + - + + + @@ -184,12 +194,12 @@ - - + - - - + + + + diff --git a/docs/source/conf.py b/docs/source/conf.py index ececed8..5a298b8 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 --------------------------------------------------- diff --git a/tests/test_bloom_filter.py b/tests/test_bloom_filter.py index 7b68b12..2362b21 100644 --- a/tests/test_bloom_filter.py +++ b/tests/test_bloom_filter.py @@ -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"]) diff --git a/tests/test_exact_hash.py b/tests/test_exact_hash.py index 4060720..e45971f 100644 --- a/tests/test_exact_hash.py +++ b/tests/test_exact_hash.py @@ -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"]) diff --git a/tests/test_minhash.py b/tests/test_minhash.py index 9607f97..52aee5a 100644 --- a/tests/test_minhash.py +++ b/tests/test_minhash.py @@ -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"]) diff --git a/tests/test_simhash.py b/tests/test_simhash.py index 46b59b5..e04e583 100644 --- a/tests/test_simhash.py +++ b/tests/test_simhash.py @@ -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"]) diff --git a/tests/test_suffix_array.py b/tests/test_suffix_array.py index e23aa39..64ad570 100644 --- a/tests/test_suffix_array.py +++ b/tests/test_suffix_array.py @@ -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"])