-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from federico123579/dev
New Beta4
- Loading branch information
Showing
17 changed files
with
561 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,6 @@ parts/ | |
sdist/ | ||
var/ | ||
wheels/ | ||
test.py | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
language: python | ||
python: | ||
- "3.5" | ||
- "3.6" | ||
before_install: | ||
- sudo apt-get update | ||
- sudo apt-get install xvfb | ||
install: | ||
- pip install -U pip | ||
- pip install -r dev-requirements.txt | ||
- pip install . | ||
before_script: | ||
# - wget https://ftp.mozilla.org/pub/firefox/releases/55.0/linux-x86_64/en-US/firefox-55.0.tar.bz2 | ||
# - tar -xjf firefox-55.0.tar.bz2 | ||
# - sudo mv firefox /opt/firefox55 | ||
# - sudo ln -s /opt/firefox55/firefox-bin /usr/bin/firefox | ||
# - wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz | ||
# - tar -xvzf geckodriver-v0.18.0-linux64.tar.gz | ||
# - rm geckodriver-v0.18.0-linux64.tar.gz | ||
# - chmod +x geckodriver | ||
# - sudo cp geckodriver /bin/geckodriver | ||
script: | ||
- py.test tests/test.py --doctest-modules --pep8 tradingAPI -v --cov tradingAPI --cov-report term-missing | ||
after_success: | ||
- coveralls | ||
group: stable | ||
dist: precise | ||
os: linux |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM ubuntu:17.10 | ||
MAINTAINER Federico Lolli | ||
RUN apt-get -qq update | ||
RUN apt-get -y install wget | ||
################## BEGIN INSTALLATION ###################### | ||
RUN apt-get -y install xvfb | ||
RUN apt-get -y install firefox | ||
RUN apt-get -y install python3.6 | ||
RUN apt-get -y install python3-venv | ||
RUN apt-get -y install git | ||
##################### INSTALLATION END ##################### | ||
##### PIP ##### | ||
RUN wget https://bootstrap.pypa.io/get-pip.py | ||
RUN python3.6 get-pip.py | ||
RUN pip install virtualenv | ||
############### | ||
# GECKODRIVER # | ||
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.16.0/geckodriver-v0.11.1-linux64.tar.gz | ||
RUN tar -xvzf geckodriver-v0.11.1-linux64.tar.gz | ||
RUN rm geckodriver-v0.11.1-linux64.tar.gz | ||
RUN chmod +x geckodriver | ||
RUN cp geckodriver /bin/ | ||
RUN rm geckodriver* | ||
############### | ||
# TRADING-BOT # | ||
WORKDIR /home | ||
RUN git clone https://github.com/federico123579/Trading212-API.git trading-api | ||
WORKDIR /home/trading-api | ||
RUN git checkout factory | ||
RUN python3.6 -m venv env | ||
RUN . env/bin/activate | ||
RUN pip install wheel | ||
RUN pip install -r dev-requirements.txt | ||
RUN pip install . | ||
############### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
python-coveralls | ||
pytest | ||
pytest-cov | ||
pytest-pep8 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,15 @@ | |
|
||
setup( | ||
name="trading212api", | ||
version="0.1b1", | ||
version="0.1b4", | ||
packages=['tradingAPI'], | ||
install_requires=[ | ||
'splinter', | ||
'pyvirtualdisplay', | ||
'bs4' | ||
], | ||
include_package_data=True, | ||
package_data={'': ['*.conf']}, | ||
zip_safe=False, | ||
author="Federico Lolli", | ||
author_email="[email protected]", | ||
|
@@ -26,4 +29,4 @@ | |
'Topic :: Software Development :: User Interfaces', | ||
'Topic :: System :: Emulators' | ||
] | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from tradingAPI import * | ||
|
||
|
||
api = API("CRITICAL") | ||
|
||
|
||
def test_launch(): | ||
assert api.launch() | ||
|
||
|
||
def test_login(): | ||
assert api.login("[email protected]", "TestTest1.") | ||
|
||
|
||
def test_movs(): | ||
api.addMov("ethereum", 1, "buy") | ||
api.checkPos() | ||
stock = [x.id for x in api.movements if x.name == | ||
"ethereum" and x.quantity == 1][0] | ||
api.closeMov(stock) | ||
api.checkPos() | ||
assert len([x.id for x in api.movements if x.name == | ||
"ethereum" and x.quantity == 1][0]) == 0 | ||
|
||
|
||
def test_clearPrefs(): | ||
assert api.clearPrefs() | ||
|
||
|
||
def test_addPrefs(): | ||
assert api.addPrefs(["bitcoin", "ethereum"]) | ||
|
||
|
||
def test_logout(): | ||
assert api.logout() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import unittest | ||
|
||
|
||
class TestAlwaysTrue(unittest.TestCase): | ||
|
||
def test_assertTrue(self): | ||
""" | ||
always_true returns a truthy value | ||
""" | ||
result = True | ||
|
||
self.assertTrue(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from .api import API | ||
from .api import API | ||
|
||
__VERSION__ = "v0.1b4" |
Oops, something went wrong.