Преглед на файлове

Committing months after the changes were made, I have no fucking clue what exactly I did.

master
Abrax преди 2 години
родител
ревизия
d9171f5426
променени са 6 файла, в които са добавени 22 реда и са изтрити 3 реда
  1. 4
    2
      README.md
  2. Двоични данни
      dist/lizard-0.4-py3-none-any.whl
  3. 1
    1
      lizard/web_methods.py
  4. 0
    0
      lizard_tests/__init__.py
  5. 17
    0
      lizard_tests/test_parse_url.py
  6. 0
    0
      setup.py

+ 4
- 2
README.md Целия файл

@@ -21,9 +21,11 @@ You can call `lizard r` to refresh threads currently in the database, and see th

## Changelog

### 0.5 (planned)
### 1.0 (planned)

### 0.4 (in development)
### 0.5 (in development)

### 0.4 (current)

Command syntax changes:
- Listing threads:

Двоични данни
dist/lizard-0.4-py3-none-any.whl Целия файл


+ 1
- 1
lizard/web_methods.py Целия файл

@@ -15,7 +15,7 @@ def fetch_and_parse_thread_json(board, thread_no, use_onion_link=False):
url = generate_thread_json_url(board, thread_no, use_onion_link=use_onion_link)
p = generate_json_path(board, thread_no)

if not download_file(url, p, use_onion_link=use_onion_link):
if not download_file(url, p):
return None
else:
return json.load(open(p))

+ 0
- 0
lizard_tests/__init__.py Целия файл


+ 17
- 0
lizard_tests/test_parse_url.py Целия файл

@@ -0,0 +1,17 @@
from unittest import TestCase

from lizard import db_methods


class TestParse_url(TestCase):
def test_parse_url(self):
urls = {
'http://8ch.net/b/res/123.html#456': ['b', '123', '456'],
'https://8ch.net/b/res/123.html#456': ['b', '123', '456'],
'http://oxwugzccvk3dk6tj.onion/b/res/123.html#456': ['b', '123', '456']
}

for u in urls:
result = db_methods.parse_url(u)

self.assertListEqual(result, urls[u])

+ 0
- 0
setup.py Целия файл


Loading…
Отказ
Запис