This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
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 #22 from njzjz/dev
test: add test processes
- Loading branch information
Showing
8 changed files
with
102 additions
and
28 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
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,15 @@ | ||
language: python | ||
matrix: | ||
include: | ||
- python: 2.7 | ||
- python: 3.5 | ||
- python: 3.6 | ||
- python: 3.7 | ||
dist: xenial | ||
sudo: true | ||
|
||
install: | ||
- pip install tox-travis | ||
|
||
script: | ||
- tox |
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
Empty file.
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,13 @@ | ||
import unittest | ||
import ecnunetwork | ||
|
||
|
||
class Testecnunetwork(unittest.TestCase): | ||
def test_loginok(self): | ||
def answerinput(inp): | ||
print(inp) | ||
return 'y' | ||
ecnunetwork.input = answerinput | ||
n = ecnunetwork.ecnunetwork(configfile='.testfile') | ||
n.url = 'https://php.njzjz.win/login_ok.php' | ||
n.connect() |
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,37 @@ | ||
from setuptools import setup | ||
setup(name='ecnunetwork', | ||
description='A script to connect to Internet at East China Normal University (ECNU).', | ||
keywords="ecnu", | ||
url='https://github.com/njzjz/ecnunetwork', | ||
author='Jinzhe Zeng', | ||
author_email='jzzeng@stu.ecnu.edu.cn', | ||
packages=['ecnunetwork'], | ||
install_requires=['requests'], | ||
entry_points={ | ||
'console_scripts': ['ecnunetwork=ecnunetwork.commandline:main', 'network=ecnunetwork.commandline:main'] | ||
}, | ||
setup_requires=['setuptools_scm'], | ||
use_scm_version=True, | ||
) | ||
import os | ||
|
||
from setuptools import find_packages, setup | ||
|
||
if __name__ == '__main__': | ||
this_directory = os.path.abspath(os.path.dirname(__file__)) | ||
with open(os.path.join(this_directory, 'docs', 'README.md')) as f: | ||
long_description = f.read() | ||
setup( | ||
name='ecnunetwork', | ||
description='A script to connect to Internet at East China Normal University (ECNU).', | ||
keywords="ecnu", url='https://github.com/njzjz/ecnunetwork', | ||
author='Jinzhe Zeng', author_email='jzzeng@stu.ecnu.edu.cn', | ||
packages=find_packages(), | ||
install_requires=['requests'], | ||
entry_points={ | ||
'console_scripts': | ||
['ecnunetwork=ecnunetwork.commandline:main', | ||
'network=ecnunetwork.commandline:main']}, | ||
setup_requires=['setuptools_scm', 'pytest-runner'], | ||
use_scm_version=True, | ||
classifiers=[ | ||
"Natural Language :: English", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: Microsoft :: Windows", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Software Development :: Version Control :: Git", | ||
], | ||
zip_safe=True, | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
tests_require=['pytest-sugar'], | ||
) |
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,14 @@ | ||
[tox] | ||
envlist = py{37,36,35,27} | ||
|
||
[testenv] | ||
passenv = CI TRAVIS TRAVIS_* CODECOV_* TOXENV | ||
deps = | ||
pytest-sugar | ||
pytest-cov | ||
coveralls | ||
codecov>=1.4.0 | ||
commands = | ||
pytest --pyargs ecnunetwork --cov {envsitepackagesdir}/ecnunetwork -s | ||
coveralls | ||
codecov -e TOXENV |