Fixes for issue #86

This commit is contained in:
Vincent Jacques
2012-09-16 20:39:00 +02:00
parent aadb06753c
commit c6609fd4da
8 changed files with 104 additions and 34 deletions
-2
View File
@@ -1,6 +1,4 @@
*.pyc
GithubCredentials.py
.coverage
/dist
/MANIFEST
/test/htmlcov/
+58
View File
@@ -0,0 +1,58 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub 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 Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
from AuthenticatedUser import *
from Authentication import *
from Authorization import *
from Branch import *
from Commit import *
from CommitComment import *
from CommitStatus import *
from ContentFile import *
from Download import *
from Event import *
from Gist import *
from GistComment import *
from GitBlob import *
from GitCommit import *
from Github import *
from GitRef import *
from GitTag import *
from GitTree import *
from Hook import *
from Issue import *
from IssueComment import *
from IssueEvent import *
from Label import *
from Milestone import *
from NamedUser import *
from Markdown import *
from Organization import *
from PullRequest import *
from PullRequestComment import *
from PullRequestFile import *
from RateLimiting import *
from Repository import *
from RepositoryKey import *
from Tag import *
from Team import *
from UserKey import *
from PaginatedList import *
from Exceptions import *
from Enterprise import *
from Issue33 import *
from Issue50 import *
from Issue54 import *
from Issue80 import *
+2 -7
View File
@@ -16,9 +16,7 @@ import sys
import unittest
import httplib
import traceback
import itertools
sys.path = [ os.path.join( os.path.dirname( __file__ ), ".." ) ] + sys.path
import github
class FakeHttpResponse:
@@ -175,8 +173,5 @@ class TestCase( BasicTestCase ):
BasicTestCase.setUp( self )
self.g = github.Github( self.login, self.password )
def main():
if "--record" in sys.argv:
BasicTestCase.recordMode = True
unittest.main( argv = [ arg for arg in sys.argv if arg != "--record" ] )
def activateRecordMode():
BasicTestCase.recordMode = True
+19
View File
@@ -0,0 +1,19 @@
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# PyGithub 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 Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see <http://www.gnu.org/licenses/>.
import unittest
import AllTests
def run():
unittest.main( module = AllTests, argv = [ "Dummy Script Name" ] )
+15
View File
@@ -0,0 +1,15 @@
import sys
import unittest
import Framework
import AllTests
def main( argv ):
if "--record" in argv:
Framework.activateRecordMode()
argv = [ arg for arg in argv if arg != "--record" ]
unittest.main( module = AllTests, argv = argv )
if __name__ == "__main__":
main( sys.argv )
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh
./run_tests.sh
python setup.py test
previousVersion=$( grep 'version =' setup.py | sed 's/.*version = \"\(.*\)\".*/\1/' )
echo "Next version number? (previous: '$previousVersion')"
-16
View File
@@ -1,16 +0,0 @@
#!/bin/sh
rm -f $(find . -name "*.pyc")
cd test
coverage erase
coverage run --branch IntegrationTest.py
echo "=============================="
echo "|| Coverage (shall be 100%) ||"
echo "=============================="
coverage report -m --include=../github/*
coverage html --include=../github/*
+9 -8
View File
@@ -16,18 +16,18 @@
from distutils.core import setup, Command
import textwrap
class TestCommand( Command ):
class test( Command ):
user_options = []
def initialize_options(self):
def initialize_options( self ):
pass
def finalize_options(self):
def finalize_options( self ):
pass
def run(self):
import sys, subprocess
raise SystemExit( subprocess.call( [ sys.executable, "test/IntegrationTest.py" ] ) )
def run( self ):
import github.tests
github.tests.run()
setup(
name = "PyGithub",
@@ -66,9 +66,10 @@ setup(
See http://vincent-jacques.net/PyGithub""" ),
packages = [
"github",
"github.tests",
],
package_data = {
"github": [ "ReadMe.md", "COPYING*", "doc/*.md" ]
"github": [ "ReadMe.md", "COPYING*", "doc/*.md", "tests/ReplayData/*.txt" ]
},
classifiers = [
"Development Status :: 5 - Production/Stable",
@@ -79,5 +80,5 @@ setup(
"Programming Language :: Python",
"Topic :: Software Development",
],
cmdclass = { "test": TestCommand },
cmdclass = { "test": test },
)