Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_distribute(self):
real_urlopen = urllib.urlopen
real_server_proxy = xmlrpclib.ServerProxy
try:
xmlrpclib.ServerProxy = ProxyStub(
"distributedata.py", xmlrpclib.ServerProxy, False
)
urllib.urlopen = urlopenstub
data = pypidata.get_data("distribute")
rating = rate(data)
self.assertEqual(
rating,
(
9,
[
"The classifiers should specify what minor versions of Python "
"you support as well as what major version.",
"You should have three or more owners of the project on PyPI.",
],
),
def test_complete(self):
real_urlopen = urllib.urlopen
real_server_proxy = xmlrpclib.ServerProxy
try:
xmlrpclib.ServerProxy = ProxyStub(
"completedata.py", xmlrpclib.ServerProxy, False
)
urllib.urlopen = urlopenstub
data = pypidata.get_data("complete")
rating = rate(data)
self.assertEqual(rating, (10, []))
finally:
xmlrpclib.ServerProxy = real_server_proxy
urllib.urlopen = real_urlopen