Skip to content

Fix TravisCI and make compatible with go-ipfs v0.4.3rc2 #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
matrix:
include:
- python: "2.7"
env: TOXENV=py27
- python: "3.3"
env: TOXENV=py33
- python: "3.4"
env: TOXENV=py34
- python: "3.5"
env: TOXENV=py35
before_script:
- wget "https://dist.ipfs.io/go-ipfs/v0.4.3-rc2/go-ipfs_v0.4.3-rc2_linux-amd64.tar.gz" -O /tmp/ipfs.tar.gz
- mkdir $HOME/bin
- pushd . && cd $HOME/bin && tar -xzvf /tmp/ipfs.tar.gz && popd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never used Travis before: Are its scripts guaranteed to be run with bash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, actually. I took the way that I did this from the TravisCI Documentation. Do you have a different way of doing this in mind?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's in the official docs then it's fine. I just have seen too many thing fail because of bashisms to not ask. 😉

- export PATH="$HOME/bin/go-ipfs:$PATH"
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
script:
- ipfs init
- ipfs daemon &
- tox -e pep8
- tox
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

Check out [ipfs](http://ipfs.io/) and [the API command reference](http://ipfs.io/docs/commands/) for more information about the IPFS API.

*Note:* This library constantly has to change to stay compatible with the IPFS HTTP API.
Currently, this library is tested against [go-ipfs v0.4.3rc2](https://github.com/ipfs/go-ipfs/releases/tag/v0.4.3-rc2).
You may experience compatibility issues when attempting to use it with other versions of go-ipfs.

## Table of Contents

- [Install](#install)
Expand Down
2 changes: 1 addition & 1 deletion ipfsApi/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ def add_str(self, string, **kwargs):
body, headers = multipart.stream_text(string,
chunk_size=chunk_size)
return self._client.request('/add', data=body,
headers=headers, **kwargs)[1]
headers=headers, **kwargs)

def add_json(self, json_obj, **kwargs):
"""Adds a json-serializable Python dict as a json file to IPFS.
Expand Down
16 changes: 5 additions & 11 deletions test/functional/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,27 @@ class IpfsApiTest(unittest.TestCase):

## test_add_multiple_from_list
fake_file = 'fake_dir/fsdfgh'
fake_file_only_res = [{'Name': 'fsdfgh', 'Bytes': 8},
{'Name': 'fsdfgh', 'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX'}]
fake_file_only_res = {'Name': 'fsdfgh',
'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX'}
fake_file2 = 'fake_dir/popoiopiu'
fake_files_res = [{'Name': 'fsdfgh', 'Bytes': 8},
fake_files_res = [
{'Name': 'fsdfgh', 'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX'},
{'Name': 'popoiopiu', 'Bytes': 15},
{'Name': 'popoiopiu', 'Hash': 'QmYAhvKYu46rh5NcHzeu6Bhc7NG9SqkF9wySj2jvB74Rkv'}]

## test_add_multiple_from_dirname
fake_dir_test2 = 'fake_dir/test2'
fake_dir_res = [{'Name': 'test2/fssdf', 'Bytes': 14},
fake_dir_res = [
{'Name': 'test2/fssdf', 'Hash': 'Qmb1NPqPzdHCMvHRfCkk6TWLcnpGJ71KnafacCMm6TKLcD'},
{'Name': 'test2/llllg', 'Bytes': 9},
{'Name': 'test2/llllg', 'Hash': 'QmNuvmuFeeWWpxjCQwLkHshr8iqhGLWXFzSGzafBeawTTZ'},
{'Name': 'test2', 'Hash': 'QmX1dd5DtkgoiYRKaPQPTCtXArUu4jEZ62rJBUcd5WhxAZ'}]

## test_add_recursive
fake_dir = 'fake_dir'
fake_dir_recursive_res = [{'Bytes': 8, 'Name': 'fake_dir/fsdfgh'},
fake_dir_recursive_res = [
{'Hash': 'QmQcCtMgLVwvMQGu6mvsRYLjwqrZJcYtH4mboM9urWW9vX', 'Name': 'fake_dir/fsdfgh'},
{'Bytes': 15, 'Name': 'fake_dir/popoiopiu'},
{'Hash': 'QmYAhvKYu46rh5NcHzeu6Bhc7NG9SqkF9wySj2jvB74Rkv', 'Name': 'fake_dir/popoiopiu'},
{'Bytes': 14, 'Name': 'fake_dir/test2/fssdf'},
{'Hash': 'Qmb1NPqPzdHCMvHRfCkk6TWLcnpGJ71KnafacCMm6TKLcD', 'Name': 'fake_dir/test2/fssdf'},
{'Bytes': 9, 'Name': 'fake_dir/test2/llllg'},
{'Hash': 'QmNuvmuFeeWWpxjCQwLkHshr8iqhGLWXFzSGzafBeawTTZ', 'Name': 'fake_dir/test2/llllg'},
{'Bytes': 8, 'Name': 'fake_dir/test3/ppppoooooooooo'},
{'Hash': 'QmeMbJSHNCesAh7EeopackUdjutTJznum1Fn7knPm873Fe', 'Name': 'fake_dir/test3/ppppoooooooooo'},
{'Hash': 'QmX1dd5DtkgoiYRKaPQPTCtXArUu4jEZ62rJBUcd5WhxAZ', 'Name': 'fake_dir/test2'},
{'Hash': 'QmRphRr6ULDEj7YnXpLdnxhnPiVjv5RDtGX3er94Ec6v4Q', 'Name': 'fake_dir/test3'},
Expand Down