コード例 #1
0
	def test_normal_parse_url(self):
		url, host, port = devicehive.parse_url('http://example.com/api/')
		self.assertEquals('http://example.com/api/', url)
		self.assertEquals('example.com', host)
		self.assertEquals(80, port)
コード例 #2
0
	def test_default_ssl_port_parse_url(self):
		url, host, port = devicehive.parse_url('https://example.com/api')
		self.assertEquals('https://example.com/api/', url)
		self.assertEquals('example.com', host)
		self.assertEquals(443, port)
コード例 #3
0
	def test_redef_ssl_port_parse_url(self):
		url, host, port = devicehive.parse_url('https://example.com:9191/api/')
		self.assertEquals('https://example.com:9191/api/', url)
		self.assertEquals('example.com', host)
		self.assertEquals(9191, port)
コード例 #4
0
	def test_def_port_parse_url(self):
		url, host, port = devicehive.parse_url('http://example.com:8181/api')
		self.assertEquals('http://example.com:8181/api/', url)
		self.assertEquals('example.com', host)
		self.assertEquals(8181, port)