|
1 | | -from solid.utils.folder_utils import parse_folder_response |
2 | | -import httpx |
| 1 | +from solid.utils.folder_utils import _parse_folder_response |
| 2 | + |
| 3 | +TEXT = ''' |
| 4 | +@prefix : <#>. |
| 5 | +@prefix dct: <http://purl.org/dc/terms/>. |
| 6 | +@prefix ldp: <http://www.w3.org/ns/ldp#>. |
| 7 | +@prefix stat: <http://www.w3.org/ns/posix/stat#>. |
| 8 | +@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. |
| 9 | +@prefix test: <>. |
| 10 | +@prefix sub: <subdir/>. |
| 11 | +@prefix jpeg: <http://www.w3.org/ns/iana/media-types/image/jpeg#>. |
| 12 | +@prefix tur: <http://www.w3.org/ns/iana/media-types/text/turtle#>. |
| 13 | +@prefix m: <http://www.w3.org/ns/iana/media-types/text/markdown#>. |
| 14 | +
|
| 15 | +test: |
| 16 | + a ldp:BasicContainer, ldp:Container; |
| 17 | + dct:modified "2021-07-06T03:24:55Z"^^xsd:dateTime; |
| 18 | + ldp:contains <picture.jpg>, <picture.jpg2>, test:qq, sub:, <testfile.md>; |
| 19 | + stat:mtime 1625541895.566; |
| 20 | + stat:size 4096. |
| 21 | +<picture.jpg> |
| 22 | + a jpeg:Resource, ldp:Resource; |
| 23 | + dct:modified "2021-06-24T02:47:10Z"^^xsd:dateTime; |
| 24 | + stat:mtime 1624502830.078; |
| 25 | + stat:size 412944. |
| 26 | +<picture.jpg2> |
| 27 | + a jpeg:Resource, ldp:Resource; |
| 28 | + dct:modified "2021-07-05T03:49:57Z"^^xsd:dateTime; |
| 29 | + stat:mtime 1625456997.73; |
| 30 | + stat:size 0. |
| 31 | +test:qq |
| 32 | + a tur:Resource, ldp:Resource; |
| 33 | + dct:modified "2021-06-22T11:08:50Z"^^xsd:dateTime; |
| 34 | + stat:mtime 1624360130.12; |
| 35 | + stat:size 0. |
| 36 | +sub: |
| 37 | + a ldp:BasicContainer, ldp:Container, ldp:Resource; |
| 38 | + dct:modified "2021-07-06T03:24:55Z"^^xsd:dateTime; |
| 39 | + stat:mtime 1625541895.566; |
| 40 | + stat:size 4096. |
| 41 | +<testfile.md> |
| 42 | + a m:Resource, ldp:Resource; |
| 43 | + dct:modified "2021-06-22T10:00:07Z"^^xsd:dateTime; |
| 44 | + stat:mtime 1624356007.481; |
| 45 | + stat:size 44. |
| 46 | +''' |
| 47 | + |
| 48 | +URL = 'https://tim.solidcommunity.net/test/' |
3 | 49 |
|
4 | 50 |
|
5 | 51 | def test_parse_folder_response(): |
6 | | - url = 'https://dahanhsi.solidcommunity.net/test/' |
7 | | - resp = httpx.get(url) |
8 | | - fold_data = parse_folder_response(resp, url) |
| 52 | + fold_data = _parse_folder_response(TEXT, URL) |
| 53 | + # TODO: assert result |
9 | 54 | pass |
0 commit comments