From 5fa841637e034c558580305f6576997f2f88f549 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 23 Aug 2024 19:53:14 +0200 Subject: [PATCH] fix imports, paths --- .github/workflows/test-stack-reusable-workflow.yml | 2 +- changedetectionio/tests/conftest.py | 2 +- changedetectionio/tests/fetchers/test_content.py | 1 - .../test_scrape_price_element.py | 8 ++++---- 4 files changed, 6 insertions(+), 7 deletions(-) rename changedetectionio/tests/{ai-price-scraper => ml_price_scraper}/test_scrape_price_element.py (95%) diff --git a/.github/workflows/test-stack-reusable-workflow.yml b/.github/workflows/test-stack-reusable-workflow.yml index 9e2b337c..1556560a 100644 --- a/.github/workflows/test-stack-reusable-workflow.yml +++ b/.github/workflows/test-stack-reusable-workflow.yml @@ -102,7 +102,7 @@ jobs: # PLAYWRIGHT/NODE-> CDP - name: ML/AI Price element scraper via Playwright+dgtlmoon/changedetection.io-ai run: | - docker run --rm -e "FLASK_SERVER_NAME=cdio" -e "PLAYWRIGHT_DRIVER_URL=ws://sockpuppetbrowser:3000" -e "PLAYWRIGHT_DRIVER_URL=ws://PRICE_SCRAPER_ML_ENDPOINT:5005/price-element" --network changedet-network --hostname=cdio test-changedetectionio bash -c 'cd changedetectionio;pytest --live-server-host=0.0.0.0 --live-server-port=5004 tests/ai-price-scraper/test_scrape_price_element.py' + docker run --rm -e "FLASK_SERVER_NAME=cdio" -e "PLAYWRIGHT_DRIVER_URL=ws://sockpuppetbrowser:3000" -e "PLAYWRIGHT_DRIVER_URL=ws://cdio-ai-price-element:5005/price-element" --network changedet-network --hostname=cdio test-changedetectionio bash -c 'cd changedetectionio;pytest --live-server-host=0.0.0.0 --live-server-port=5004 tests/ml_price_scraper/test_scrape_price_element.py' - name: Playwright and SocketPuppetBrowser - Restock detection run: | diff --git a/changedetectionio/tests/conftest.py b/changedetectionio/tests/conftest.py index 50f7104b..1a0cb804 100644 --- a/changedetectionio/tests/conftest.py +++ b/changedetectionio/tests/conftest.py @@ -8,7 +8,7 @@ from changedetectionio import changedetection_app from changedetectionio import store import os import sys -from loguru import logger + # https://github.com/pallets/flask/blob/1.1.2/examples/tutorial/tests/test_auth.py # Much better boilerplate than the docs diff --git a/changedetectionio/tests/fetchers/test_content.py b/changedetectionio/tests/fetchers/test_content.py index 8d468cd4..569703ca 100644 --- a/changedetectionio/tests/fetchers/test_content.py +++ b/changedetectionio/tests/fetchers/test_content.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import time from flask import url_for from ..util import live_server_setup, wait_for_all_checks import logging diff --git a/changedetectionio/tests/ai-price-scraper/test_scrape_price_element.py b/changedetectionio/tests/ml_price_scraper/test_scrape_price_element.py similarity index 95% rename from changedetectionio/tests/ai-price-scraper/test_scrape_price_element.py rename to changedetectionio/tests/ml_price_scraper/test_scrape_price_element.py index 1ad8581f..b2a5d630 100644 --- a/changedetectionio/tests/ai-price-scraper/test_scrape_price_element.py +++ b/changedetectionio/tests/ml_price_scraper/test_scrape_price_element.py @@ -1,11 +1,11 @@ - -#!/usr/bin/env python3 import os -import time from flask import url_for -from ..util import live_server_setup, wait_for_all_checks, extract_UUID_from_client +from changedetectionio.tests.util import set_original_response, set_modified_response, set_more_modified_response, live_server_setup, \ + wait_for_all_checks, \ + set_longer_modified_response +import time # No semantic data just some text, we should be able to find the product price. def set_response(price="121.95"):