Skip to content

Instantly share code, notes, and snippets.

@ugurcan377
Created August 14, 2012 11:55
Show Gist options
  • Save ugurcan377/3348656 to your computer and use it in GitHub Desktop.
Save ugurcan377/3348656 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
#
# spyne - Copyright (C) Spyne contributors.
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library 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 this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
#
import os
import time
import unittest
try:
from urllib import urlencode
from urllib2 import urlopen
from urllib2 import Request
from urllib2 import HTTPError
except ImportError:
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import HTTPError
_server_started = False
class TestSpynePi(unittest.TestCase):
def setUp(self):
global _server_started
if not _server_started:
def run_server():
from spynepi.test.test_server import main
main()
import thread
thread.start_new_thread(run_server, ())
# FIXME: Does anybody have a better idea?
time.sleep(2)
_server_started = True
def test_upload(self):
pth = os.path.abspath("example")
print os.listdir(pth)
f = os.popen("python %s register -r http://localhost:6666 sdist upload -r http://localhost:6666" %(pth+"/setup.py"))
print f.read()
assert False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment