HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
ftests.ftest_SiteProxy.Test Class Reference
Inheritance diagram for ftests.ftest_SiteProxy.Test:
Collaboration diagram for ftests.ftest_SiteProxy.Test:

Public Member Functions

def test_01_ProxySimple (self)
 
def test_02_ProxyPropertyMode (self)
 
def test_03_ProxyDBMode (self)
 
def test_04_ProxyLimits (self)
 
def test_05_ProxyLimitsExtend (self)
 

Detailed Description

Definition at line 82 of file ftest_SiteProxy.py.

Member Function Documentation

◆ test_01_ProxySimple()

def ftests.ftest_SiteProxy.Test.test_01_ProxySimple (   self)

Definition at line 85 of file ftest_SiteProxy.py.

85  def test_01_ProxySimple(self):
86  dbWrapper = FakeDBWrapper()
87  siteId = "1"
88  url = "http://www.latimes.com/local/lanow/la-me-ln-kamala-harris-lawsuit-car-donation-charities-20151201-story.html"
89  siteProperties = {"HTTP_PROXY_HOST": "host.com", "HTTP_PROXY_PORT": "8989", "USER_PROXY": "{}"}
90  proxyResolver = ProxyResolver(siteProperties, dbWrapper, siteId, url)
91  result = proxyResolver.getProxy()
92  self.assertTrue(result == ("host.com", "8989"))
93 
94 

◆ test_02_ProxyPropertyMode()

def ftests.ftest_SiteProxy.Test.test_02_ProxyPropertyMode (   self)

Definition at line 95 of file ftest_SiteProxy.py.

95  def test_02_ProxyPropertyMode(self):
96  dbWrapper = FakeDBWrapper()
97  siteId = "1"
98  url = "http://www.latimes.com/local/lanow/la-me-ln-kamala-harris-lawsuit-car-donation-charities-20151201-story.html"
99  siteProperties = {"USER_PROXY": "{\"source\": 0, \"file_path\": \"file11.json\", \"proxies\": " +
100  "{\"toxic.com:9000\" : {\"host\": \"toxic.com:9000\", \"domains\":[\"www.latimes.com\"]," +
101  "\"priority\": 44, \"limits\": null}, " +
102  "\"proxic.com:9000\" : {\"host\": \"proxic.com:9000\", \"domains\":[\"*\"]," +
103  "\"priority\": 11, \"limits\": null}, " +
104  "\"nosic.com:9000\" : {\"host\": \"nosic.com:9000\", \"domains\":[\"www.latimes.com\"]," +
105  "\"priority\": 1, \"limits\": null}}}"
106  }
107  proxyResolver = ProxyResolver(siteProperties, dbWrapper, siteId, url)
108  result = proxyResolver.getProxy()
109  self.assertTrue(result == ("nosic.com", "9000"))
110 
111 

◆ test_03_ProxyDBMode()

def ftests.ftest_SiteProxy.Test.test_03_ProxyDBMode (   self)

Definition at line 112 of file ftest_SiteProxy.py.

112  def test_03_ProxyDBMode(self):
113  dbWrapper = FakeDBWrapper()
114  siteId = "1"
115  url = "http://www.latimes.com/local/lanow/la-me-ln-kamala-harris-lawsuit-car-donation-charities-20151201-story.html"
116  siteProperties = {"USER_PROXY": "{\"source\": 1, \"file_path\": \"file11.json\", \"proxies\": {}}"}
117  proxyResolver = ProxyResolver(siteProperties, dbWrapper, siteId, url)
118  result = proxyResolver.getProxy()
119  self.assertTrue(result == ("ibm.com", "9090"))
120 
121 

◆ test_04_ProxyLimits()

def ftests.ftest_SiteProxy.Test.test_04_ProxyLimits (   self)

Definition at line 122 of file ftest_SiteProxy.py.

122  def test_04_ProxyLimits(self):
123  dbWrapper = FakeDBWrapper()
124  dbWrapper.TYPE = 1
125  siteId = "1"
126  url = "http://www.latimes.com/local/lanow/la-me-ln-kamala-harris-lawsuit-car-donation-charities-20151201-story.html"
127  siteProperties = {"USER_PROXY": "{\"source\": 1, \"file_path\": \"file22.json\", \"proxies\": {}}"}
128  proxyResolver = ProxyResolver(siteProperties, dbWrapper, siteId, url)
129  result = proxyResolver.getProxy()
130  self.assertTrue(result == ("intel.com", "11"))
131 
132 

◆ test_05_ProxyLimitsExtend()

def ftests.ftest_SiteProxy.Test.test_05_ProxyLimitsExtend (   self)

Definition at line 133 of file ftest_SiteProxy.py.

133  def test_05_ProxyLimitsExtend(self):
134  dbWrapper = FakeDBWrapper()
135  dbWrapper.TYPE = 1
136  siteId = "1"
137  url = "http://www.latimes.com/local/lanow/la-me-ln-kamala-harris-lawsuit-car-donation-charities-20151201-story.html"
138  siteProperties = {"USER_PROXY": "{\"source\": 1, \"file_path\": \"file33.json\", \"proxies\": {}}"}
139  proxyResolver = ProxyResolver(siteProperties, dbWrapper, siteId, url)
140  result = proxyResolver.getProxy()
141  self.assertTrue(result == ("intel.com", "44"))
142 
143 

The documentation for this class was generated from the following file: