feat(definitions): add expectations for test lines (#1257)

* factor out test helpers

* refactor, add tests for animebytes

* revert test refactor

* better name

* change format, migrate some examples

* migrated remaining test cases

* add comment about `Test` vs `Tests`

* refactor

* reorder expectations to match vars

* generate

* turn on strict unmarshalling, remove old `Test` from schema

* start modifying actual definitions

* done with the As

* Bs

* C, D

* E, F

* G, H, I, ... L

* M, N

* O, P

* R

* bonus error. without this, pattern/vars disagreement can panic.

* S

* T, U

* X.. Now we know our ABCs next time won't you sing with meeeee

* fix another test

* another driveby change

* be less strict parsing custom definitions

* fix(definitions): load custom definitions

---------

Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
Frederick Robinson 2023-11-18 06:41:39 -08:00 committed by GitHub
parent e842a7bd42
commit fef0da5711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
83 changed files with 1887 additions and 565 deletions

View file

@ -12,7 +12,7 @@ supports:
- api
- irc
- rss
source: gazelle
# source: gazelle
settings:
- name: torrent_pass
type: text
@ -26,17 +26,17 @@ settings:
label: API Key
help: Settings -> Access Settings -> API Keys - Create a new api token.
api:
url: https://orpheus.network/ajax.php
type: json
limits:
max: 5
per: 10 seconds
settings:
- name: api_key
type: secret
label: API Key
help: Settings -> Access Settings -> API Keys - Create a new api token.
# api:
# url: https://orpheus.network/ajax.php
# type: json
# limits:
# max: 5
# per: 10 seconds
# settings:
# - name: api_key
# type: secret
# label: API Key
# help: Settings -> Access Settings -> API Keys - Create a new api token.
irc:
network: Orpheus
@ -76,10 +76,34 @@ irc:
parse:
type: single
lines:
- test:
- "TORRENT: Dirty Dike Bogies & Alcohol [2008] [Album] CD/MP3/320 hip.hop,uk.hip.hop,united.kingdom https://orpheus.network/torrents.php?id=0000000 https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download"
- "TORRENT: Various Artists Bicycle Day: 85 Yrs of LSD Special [2023] [Compilation] WEB/FLAC/Lossless ambient,electronic https://orpheus.network/torrents.php?id=0000000 https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download"
- "TORRENT: Snoop Dogg Untitled [2001] [Sampler] Vinyl/MP3/320 https://orpheus.network/torrents.php?id=0000000 https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download"
- tests:
- line: 'TORRENT: Dirty Dike Bogies & Alcohol [2008] [Album] CD/MP3/320 hip.hop,uk.hip.hop,united.kingdom https://orpheus.network/torrents.php?id=0000000 https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download'
expect:
torrentName: Dirty Dike Bogies & Alcohol [2008] [Album] CD/MP3/320
year: "2008"
category: Album
releaseTags: CD/MP3/320
tags: hip.hop,uk.hip.hop,united.kingdom
baseUrl: https://orpheus.network/
torrentId: "0000000"
- line: 'TORRENT: Various Artists Bicycle Day: 85 Yrs of LSD Special [2023] [Compilation] WEB/FLAC/Lossless ambient,electronic https://orpheus.network/torrents.php?id=0000000 https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download'
expect:
torrentName: 'Various Artists Bicycle Day: 85 Yrs of LSD Special [2023] [Compilation] WEB/FLAC/Lossless'
year: "2023"
category: Compilation
releaseTags: WEB/FLAC/Lossless
tags: ambient,electronic
baseUrl: https://orpheus.network/
torrentId: "0000000"
- line: 'TORRENT: Snoop Dogg Untitled [2001] [Sampler] Vinyl/MP3/320 https://orpheus.network/torrents.php?id=0000000 https://orpheus.network/torrents.php?id=0000000&torrentid=0000000&action=download'
expect:
torrentName: Snoop Dogg Untitled [2001] [Sampler] Vinyl/MP3/320
year: "2001"
category: Sampler
releaseTags: Vinyl/MP3/320
tags: ""
baseUrl: https://orpheus.network/
torrentId: "0000000"
pattern: 'TORRENT: (.* . \[(.*?)\] \[(.*?)\] (.*)) . \s*(.*) . https?:\/\/.* . (https?:\/\/.*\/).*torrentid=(\d+).*'
vars:
- torrentName