This commit is contained in:
parent
cdf651b804
commit
e72d1d2aee
4 changed files with 32 additions and 4 deletions
30
.forgejo/workflows/test.yaml
Normal file
30
.forgejo/workflows/test.yaml
Normal file
|
@ -0,0 +1,30 @@
|
|||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_call:
|
||||
|
||||
|
||||
env:
|
||||
SLIGRO_USERNAME: ${{ secrets.SLIGRO_USERNAME }}
|
||||
SLIGRO_PASSWORD: ${{ secrets.SLIGRO_PASSWORD }}
|
||||
|
||||
jobs:
|
||||
|
||||
pytest:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:latest
|
||||
steps:
|
||||
- run: apk add nodejs py3-pip ruff
|
||||
- uses: actions/checkout@v4
|
||||
- run: pip install -r requirements.txt --break-system-packages
|
||||
|
||||
- run: pytest
|
||||
|
||||
- run: ruff check
|
|
@ -2,7 +2,6 @@ from dataclasses import dataclass
|
|||
from decimal import Decimal, ROUND_UP
|
||||
from typing import Dict, Optional, List
|
||||
import logging
|
||||
import re
|
||||
import scrapers
|
||||
import shlex
|
||||
|
||||
|
@ -79,7 +78,7 @@ def update_product_pricings(src):
|
|||
for line in src.split('\n'):
|
||||
try:
|
||||
product = Product.from_line(line)
|
||||
except Exception as err:
|
||||
except Exception:
|
||||
lines_out.append(line)
|
||||
continue
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ import json
|
|||
import re
|
||||
import os
|
||||
import requests
|
||||
import subprocess
|
||||
import logging
|
||||
from supermarktconnector.ah import AHConnector
|
||||
from typing import List
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
from scrapers import *
|
||||
from scrapers import ah_get_by_gtin, sligro_get_by_gtin, parse_content_description, Product
|
||||
|
||||
|
||||
def test_scrape_ah():
|
||||
|
|
Loading…
Add table
Reference in a new issue