Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(6)  |  Derive(0)  |  Import(1)

        	def wrapper(url, *args, **kwargs):
		schema = url.split('://')[0]

		if schema in ['http', 'https']:
			return function(url, *args, **kwargs)
		else:
			raise InvalidUrlSchema()
        


src/s/e/seolib-0.1.3/seolib/__init__.py   seolib(Download)
 
from api import get_seomoz_data
from api import get_alexa
from api import get_semrush
from api import get_tweets

src/s/e/seolib-0.1.3/seolib/tests.py   seolib(Download)
	def test_schema_validation_bad_url(self):
		with self.assertRaises(errors.InvalidUrlSchema):
			alexa = api.get_alexa(self.bad_url)
 
 
 
	def test_schema_validation_valid_url(self):
		alexa = api.get_alexa(self.valid_url)
	def test_schema_validation_without_schema(self):
		with self.assertRaises(errors.InvalidUrlSchema):
			alexa = api.get_alexa(self.valid_url_without_schema)
 
 
 
	def test_get_alexa_fake_url(self):
		alexa = api.get_alexa(self.fake_url)
	def test_get_alexa_valid_url(self):
		alexa = api.get_alexa(self.valid_url)
		self.assertIsInstance(alexa, int)