コード例 #1
0
 def test_parse_uri_scheme(self):
     exprStr = "chrome-extension:"
     srcExpr = SourceExpressionParser().parse(exprStr)
     assert srcExpr == URISourceExpression("chrome-extension", None, None, None)
     assert srcExpr.getType() == "uri"
     assert srcExpr.getScheme() == "chrome-extension"
     assert srcExpr.getHost() == None
     assert srcExpr.getPort() == None
     assert srcExpr.getPath() == None
     assert str(srcExpr) == exprStr
コード例 #2
0
 def test_parse_uri_full(self):
     exprStr = "http://seclab.nu:80/path"
     srcExpr = SourceExpressionParser().parse(exprStr)
     assert srcExpr == URISourceExpression("http", "seclab.nu", 80, "/path")
     assert srcExpr.getType() == "uri"
     assert srcExpr.getScheme() == "http"
     assert srcExpr.getHost() == "seclab.nu"
     assert srcExpr.getPort() == 80
     assert srcExpr.getPath() == "/path"
     assert str(srcExpr) == exprStr
コード例 #3
0
 def test_parse_uri_full(self):
     exprStr = "http://seclab.nu:80/path"
     srcExpr = SourceExpressionParser().parse(exprStr)
     assert srcExpr == URISourceExpression("http", "seclab.nu", 80, "/path")
     assert srcExpr.getType() == "uri"
     assert srcExpr.getScheme() == "http"
     assert srcExpr.getHost() == "seclab.nu"
     assert srcExpr.getPort() == 80
     assert srcExpr.getPath() == "/path"
     assert str(srcExpr) == exprStr
コード例 #4
0
 def test_parse_uri_scheme(self):
     exprStr = "chrome-extension:"
     srcExpr = SourceExpressionParser().parse(exprStr)
     assert srcExpr == URISourceExpression("chrome-extension", None, None,
                                           None)
     assert srcExpr.getType() == "uri"
     assert srcExpr.getScheme() == "chrome-extension"
     assert srcExpr.getHost() == None
     assert srcExpr.getPort() == None
     assert srcExpr.getPath() == None
     assert str(srcExpr) == exprStr