diff --git a/freedium-library/src/freedium_library/services/medium/static/medium_domains.txt b/freedium-library/src/freedium_library/services/medium/static/medium_domains.txt index b747c4d..f3e851a 100644 --- a/freedium-library/src/freedium_library/services/medium/static/medium_domains.txt +++ b/freedium-library/src/freedium_library/services/medium/static/medium_domains.txt @@ -4,7 +4,6 @@ osintteam.blog ahmedelfakharany.com drlee.io generativeai.pub -productcoalition.com towardsdev.com infosecwriteups.com towardsdatascience.com diff --git a/freedium-library/src/freedium_library/services/medium/static/non_active_medium_domains.txt b/freedium-library/src/freedium_library/services/medium/static/non_active_medium_domains.txt new file mode 100644 index 0000000..71f361c --- /dev/null +++ b/freedium-library/src/freedium_library/services/medium/static/non_active_medium_domains.txt @@ -0,0 +1 @@ +productcoalition.com diff --git a/freedium-library/src/freedium_library/services/medium/static/test_static.py b/freedium-library/src/freedium_library/services/medium/static/test_static.py index 7d61e20..c1eaab8 100644 --- a/freedium-library/src/freedium_library/services/medium/static/test_static.py +++ b/freedium-library/src/freedium_library/services/medium/static/test_static.py @@ -43,12 +43,14 @@ def get_domains_from_file(filepath: str) -> list[str]: return domains +def get_file_path(filename: str) -> str: + return os.path.join(os.path.dirname(os.path.abspath(__file__)), filename) + + @pytest.mark.integration @pytest.mark.parametrize( "domain", - get_domains_from_file( - os.path.join(os.path.dirname(os.path.abspath(__file__)), "medium_domains.txt") - ), + get_domains_from_file(get_file_path("medium_domains.txt")), ) def test_medium_domain_meta_tag(domain: str): logger.info(f"Starting test for domain: {domain}") @@ -56,3 +58,17 @@ def test_medium_domain_meta_tag(domain: str): assert result is not None, f"Failed to check domain {domain}" assert result is True, f"Domain {domain} does not have Medium meta tag" logger.success(f"Test passed for domain: {domain}") + + +@pytest.mark.integration +@pytest.mark.parametrize( + "domain", + get_domains_from_file(get_file_path("non_active_medium_domains.txt")), +) +def test_non_active_medium_domain(domain: str): + logger.info(f"Starting test for non-active domain: {domain}") + result = check_medium_meta_tag(domain) + assert ( + result is False or result is None + ), f"Domain {domain} should be non-active but appears to be active" + logger.success(f"Test passed for non-active domain: {domain}")