forked from tomgross/pcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test infrastructure and switch to MIT license
- Loading branch information
Showing
14 changed files
with
121 additions
and
378 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 |
---|---|---|
|
@@ -33,3 +33,6 @@ report.html | |
!.gitkeep | ||
!.travis.yml | ||
!src/pycloud | ||
.cache | ||
.eggs | ||
.tox |
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,4 +1,4 @@ | ||
graft src/collective | ||
graft src/pycloud | ||
graft docs | ||
include *.rst | ||
global-exclude *.pyc | ||
global-exclude *.py[co] |
This file was deleted.
Oops, something went wrong.
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,15 +1,22 @@ | ||
collective.foo Copyright 2017, b'Tom Gross' | ||
The MIT License | ||
|
||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License version 2 | ||
as published by the Free Software Foundation. | ||
Copyright (c) 2017 Tom Gross | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with this program; if not, write to the Free Software | ||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
MA 02111-1307 USA. |
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,5 +1,5 @@ | ||
==================== | ||
collective.foo | ||
pycloud | ||
==================== | ||
|
||
User documentation |
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 |
---|---|---|
|
@@ -14,3 +14,6 @@ force_single_line = True | |
lines_after_imports = 2 | ||
line_length = 200 | ||
not_skip = __init__.py | ||
|
||
[aliass] | ||
test=tox |
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 |
---|---|---|
|
@@ -16,20 +16,22 @@ | |
name='pycloud', | ||
version='1.0a1', | ||
description="A client library for pCloud", | ||
long_description=long_description, | ||
long_description='', #long_description, | ||
# Get more from https://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
classifiers=[ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"Environment :: Web Environment", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3.5", | ||
"Operating System :: OS Independent", | ||
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)", | ||
"License :: OSI Approved :: MIT License", | ||
], | ||
keywords='Python pCloud REST', | ||
author='Tom Gross', | ||
author_email='[email protected]', | ||
url='https://pypi.python.org/pypi/pycloud', | ||
license='GPL version 2', | ||
license='MIT', | ||
packages=find_packages('src', exclude=['ez_setup']), | ||
package_dir={'': 'src'}, | ||
include_package_data=True, | ||
|
@@ -38,10 +40,6 @@ | |
'requests', | ||
'setuptools', | ||
], | ||
extras_require={ | ||
'test': [ | ||
], | ||
}, | ||
entry_points={ | ||
'console_scripts': [ | ||
'pycloud-cli = pycloud.api:main', | ||
|
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
Empty file.
File renamed without changes.
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,6 @@ | ||
# | ||
|
||
class TestPathIdentifier(object): | ||
|
||
def test_validiate(self): | ||
assert 1 == 1 |
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,37 @@ | ||
from decorator import decorator | ||
|
||
def validate_folder_identifier(): | ||
"""A decorator that tests whether `path` or `folderid` has been specified. | ||
Usage: | ||
@validate_folder_identifier | ||
def foo(path=None, folderid=None, c=None): | ||
pass | ||
""" | ||
def _validate_folder_identifier(func): | ||
"""The actual decorator""" | ||
signature_params = _get_arg_spec(func, required_params) | ||
|
||
def wrapped(f, *args, **kwargs): | ||
"""The wrapped function""" | ||
if folderid is not None: | ||
params['folderid'] = folderid | ||
elif path is not None: | ||
params['path'] = path | ||
else: | ||
raise ValueError('Either `folderid` or `path` must be specified!') | ||
supplied_args = _get_supplied_args(signature_params, args, kwargs) | ||
|
||
missing = [p for p in required_params if p not in supplied_args] | ||
if len(missing): | ||
raise MissingParameterError( | ||
'Missing required parameter(s): {0}'.format( | ||
', '.join(missing)) | ||
) | ||
|
||
return f(*args, **kwargs) | ||
|
||
return decorator(wrapped, func) | ||
|
||
return _validate_folder_identifier | ||
|
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 @@ | ||
pytest >= 2.8 |
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,5 @@ | ||
[testenv] | ||
deps = | ||
-rtest_requirements.txt | ||
commands = py.test | ||
usedevelop = True |