File tree 6 files changed +56
-7
lines changed
6 files changed +56
-7
lines changed Original file line number Diff line number Diff line change @@ -208,8 +208,7 @@ You can submit bug reports using the
208
208
209
209
# ## Setting up a local development environment
210
210
211
- 1 . Follow the instructions in the IPFS documentation to install go- IPFS into your `$ {PATH }` :
212
- https:// docs.ipfs.io/ install/ command- line/
211
+ 1 . [Install and configure a local IPFS server](tools/ ipfs/ README .md):
213
212
2 . Follow the instructions in the (Python) tox documentation to install the `tox` Python environment runner:
214
213
https:// tox.readthedocs.io/ en/ latest/ install.html
215
214
3 . Clone the GIT repository if you haven' t already:
@@ -235,7 +234,13 @@ make sure that your code passes both the
235
234
236
235
$ tox - e styleck - e typeck
237
236
238
- As well as the unit tests:
237
+ As well as the tests:
238
+
239
+ 1 . Start IPFS server (do this once in a separate terminal):
240
+
241
+ $ ./ tools/ ipfs/ run.sh
242
+
243
+ 2 . Execute unit and functional tests:
239
244
240
245
$ tox - e py3 - e py3- httpx
241
246
Original file line number Diff line number Diff line change 1
1
# Note that this file is special in that py.test will automatically import this file and gather
2
2
# its list of fixtures even if it is not directly imported into the corresponding test case.
3
- import pathlib
4
3
4
+ import pathlib
5
5
import pytest
6
6
7
7
import ipfshttpclient
Original file line number Diff line number Diff line change 1
- import pathlib
1
+ from pathlib import Path
2
2
3
3
import pytest
4
4
5
5
import ipfshttpclient .exceptions
6
6
7
7
8
8
class Resources :
9
- def __init__ (self , client , source_folder : pathlib . Path ) -> None :
9
+ def __init__ (self , client , source_folder : Path ) -> None :
10
10
self .msg = client .add_str ("Mary had a little lamb" )
11
11
self .msg2 = client .add_str ("Mary had a little alpaca" )
12
- resp_add = client .add (source_folder , recursive = True )
12
+ resp_add = client .add (str ( source_folder ) , recursive = True )
13
13
self .fake_dir_hashes = [el ["Hash" ] for el in resp_add if "Hash" in el ]
14
14
for resp in resp_add :
15
15
if resp ["Name" ] == "fake_dir" :
Original file line number Diff line number Diff line change
1
+
2
+ # Local IPFS Server
3
+
4
+ ` py-ipfs-httpclient ` requires a live local server to run its
5
+ functional tests.
6
+
7
+ ## Installation
8
+
9
+ To install it, follow the [ official instructions] ( https://docs.ipfs.io/install/command-line/ ) ,
10
+ then finish with some [ local configuration] ( configure.sh ) :
11
+
12
+ $ ./configure.sh
13
+
14
+ The above script is run once after installing.
15
+
16
+ ## Running Tests
17
+
18
+ You can run unit tests without a live server; ` pytest ` will skip
19
+ over the functional tests when our fixtures detect the server
20
+ isn't running.
21
+
22
+ In a separate terminal, start IPFS with:
23
+
24
+ $ ./run.sh
25
+
26
+ Stop it with Ctrl+C. You can keep it running across multiple
27
+ executions of the functional test suite.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Configures, but does not start, the IPFS daemon. Run once in your environment.
4
+ #
5
+ # Description of experimental features:
6
+ # https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#ipfs-filestore
7
+
8
+ set -e
9
+
10
+ ipfs init
11
+ ipfs config --json Experimental.FilestoreEnabled true
12
+ ipfs config --json Experimental.UrlstoreEnabled true
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Run the IPFS server. To stop it, press Ctrl+C.
4
+
5
+ ipfs daemon --enable-namesys-pubsub
You can’t perform that action at this time.
0 commit comments