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
ftest_DCC.py
Go to the documentation of this file.
1 '''
2 Created on Apr 14, 2014
3 
4 @package: dc
5 @author: scorp
6 @link: http://hierarchical-cluster-engine.com/
7 @copyright: Copyright © 2013-2014 IOIX Ukraine
8 @license: http://hierarchical-cluster-engine.com/license/
9 @since: 0.1
10 '''
11 import ppath
12 
13 from transport.ConnectionBuilderLight import ConnectionBuilderLight
14 from dc.Constants import EVENT_TYPES as EVENT_TYPES
15 from dcc.DCC import DCC
16 from mock import MagicMock
17 try:
18  import cPickle as pickle
19 except ImportError:
20  import pickle
21 import unittest
22 import dc.EventObjects
23 import transport.Event
24 import dc.Constants
25 
26 fName = None
27 
28 class ConnectionStub(object):
29 
30 
31  def __init__(self):
32  self.eventType = None
33  self.id = 0
34  self.event = None
35 
36 
37  def send(self, event):
38  global fName
39  self.eventType = event.eventType
40  self.event = event
41  if hasattr(event.eventObj, "id"):
42  self.id = event.eventObj.id
43  else:
44  self.id = None
45  if fName != None:
46  drceSave = dc.Constants.DRCESyncTasksCover(self.eventType, event.eventObj)
47  pickleStr = pickle.dumps(drceSave)
48  f = open(fName, "w")
49  f.write(pickleStr)
50  f.close()
51  if event.cookie != None:
52  print(">>> Event.cookie = %s" % event.cookie)
53 
54 
55  def poll(self, timeout):
56  return 1
57 
58 
59  def recv(self):
60  eventObj = None
61  retEventType = None
62  eventBulder = transport.Event.EventBuilder()
63  if self.eventType >= EVENT_TYPES.SITE_NEW and self.eventType <= EVENT_TYPES.URL_PURGE:
64  retEventType = self.eventType + (EVENT_TYPES.SITE_NEW_RESPONSE - EVENT_TYPES.SITE_NEW)
65  eventObj = dc.EventObjects.ClientResponse([])
66  eventObj.itemsList.append(dc.EventObjects.ClientResponseItem(None))
67  eventObj.itemsList.append(dc.EventObjects.ClientResponseItem(None))
68  eventObj.itemsList[0].host = "host1"
69  eventObj.itemsList[1].host = "host2"
70  return eventBulder.build(retEventType, eventObj)
71 
72 
73 def connectionBuilderMockBuild(type, addr, networkType):
74  return ConnectionStub()
75 
76 
77 class TestDCC(unittest.TestCase):
78 
79  def setUp(self):
80  self.dtmc = None
81  self.connectionBuilderMock = MagicMock(spec=ConnectionBuilderLight)
82  self.connectionBuilderMock.build.side_effect = connectionBuilderMockBuild
83 
84 
85  def tearDown(self):
86  pass
87 
88 
89  def commonTestCode(self, args, isSave):
90  self.dcc = DCC()
91  self.dcc.connectionBuilder = self.connectionBuilderMock
92  DCC.argv = args
93  self.dcc.setup()
94  try:
95  self.dcc.run()
96  except SystemExit as excp:
97  print("\nEXIT CODE >>> " + str(excp.message))
98  self.dcc.close()
99 
100  '''
101  def testFunctionalHELP(self):
102  global fName
103  print("HELP TEST START >>> \n")
104  self.commonTestCode(["-h"], False)
105 
106 
107  def testFunctionalSiteNewBad1(self):
108  global fName
109  fName = "./save_pic/dcc_site_new_bad1.json"
110  print("SITE NEW BAD1 START >>> \n")
111  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_bad1.json", "--config", "./dcc.ini"], False)
112 
113 
114  def testFunctionalSiteNewBad2(self):
115  global fName
116  fName = "./save_pic/dcc_site_new_bad2.json"
117  print("SITE NEW BAD2 START >>> \n")
118  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_bad2.json", "--config", "./dcc.ini"], False)
119 
120 
121  def testFunctionalSiteNewBad3(self):
122  global fName
123  fName = "./save_pic/dcc_site_new_bad3.json"
124  print("SITE NEW BAD3 START >>> \n")
125  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_bad3.json", "--config", "./dcc.ini"], False)
126  '''
127 
129  global fName
130  fName = "./save_pic/dcc_site_new_ok.json"
131  print("SITE NEW OK START >>> \n")
132  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_ok.json", "--config", "./dcc.ini"], True)
133 
134  '''
135  def testFunctionalSiteNewOk1(self):
136  global fName
137  fName = "./save_pic/dcc_site_new_ok_1.json"
138  print("SITE NEW OK 1 START >>> \n")
139  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_ok_1.json", "--config", "./dcc.ini"], True)
140 
141 
142  def testFunctionalSiteNewOk2(self):
143  global fName
144  fName = "./save_pic/dcc_site_new_ok_2.json"
145  print("SITE NEW OK 2 START >>> \n")
146  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_ok_2.json", "--config", "./dcc.ini"], True)
147 
148 
149  def testFunctionalSiteNewOk3(self):
150  global fName
151  fName = "./save_pic/dcc_site_new_ok_3.json"
152  print("SITE NEW OK 3 START >>> \n")
153  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_ok_3.json", "--config", "./dcc.ini"], True)
154 
155 
156  def testFunctionalSiteUpdateBad1(self):
157  global fName
158  fName = "./save_pic/dcc_site_update_bad1.json"
159  print("SITE UPDATE BAD1 START >>> \n")
160  self.commonTestCode(["-cmd", "SITE_UPDATE", "-f", "./jsons/dcc_site_update_bad1.json", "--config", "./dcc.ini"],
161  False)
162 
163 
164  def testFunctionalSiteUpdateBad2(self):
165  global fName
166  fName = "./save_pic/dcc_site_update_bad2.json"
167  print("SITE UPDATE BAD2 START >>> \n")
168  self.commonTestCode(["-cmd", "SITE_UPDATE", "-f", "./jsons/dcc_site_update_bad2.json", "--config", "./dcc.ini"],
169  False)
170 
171 
172  def testFunctionalSiteUpdateBad3(self):
173  global fName
174  fName = "./save_pic/dcc_site_update_bad3.json"
175  print("SITE UPDATE BAD3 START >>> \n")
176  self.commonTestCode(["-cmd", "SITE_UPDATE", "-f", "./jsons/dcc_site_update_bad3.json", "--config", "./dcc.ini"],
177  False)
178 
179 
180  def testFunctionalSiteUpdateOk(self):
181  global fName
182  fName = "./save_pic/dcc_site_update_ok.json"
183  print("SITE UPDATE OK START >>> \n")
184  self.commonTestCode(["-cmd", "SITE_UPDATE", "-f", "./jsons/dcc_site_update_ok.json", "--config", "./dcc.ini"],
185  True)
186 
187 
188  def testFunctionalSiteUpdateOk1(self):
189  global fName
190  fName = "./save_pic/dcc_site_update_ok_1.json"
191  print("SITE UPDATE OK1 START >>> \n")
192  self.commonTestCode(["-cmd", "SITE_UPDATE", "-f", "./jsons/dcc_site_update_ok_1.json", "--config", "./dcc.ini"],
193  True)
194 
195 
196  def testFunctionalSiteStatusBad1(self):
197  global fName
198  fName = "./save_pic/dcc_site_status_bad1.json"
199  print("SITE STATUS BAD1 START >>> \n")
200  self.commonTestCode(["-cmd", "SITE_STATUS", "-f", "./jsons/dcc_site_status_bad1.json", "--config", "./dcc.ini"],
201  False)
202 
203 
204  def testFunctionalSiteStatusBad2(self):
205  global fName
206  fName = "./save_pic/dcc_site_status_bad2.json"
207  print("SITE STATUS BAD2 START >>> \n")
208  self.commonTestCode(["-cmd", "SITE_STATUS", "-f", "./jsons/dcc_site_status_bad2.json", "--config", "./dcc.ini"],
209  False)
210 
211 
212  def testFunctionalSiteStatusOk(self):
213  global fName
214  fName = "./save_pic/dcc_site_status_ok.json"
215  print("SITE STATUS OK START >>> \n")
216  self.commonTestCode(["-cmd", "SITE_STATUS", "-f", "./jsons/dcc_site_status_ok.json", "--config", "./dcc.ini"],
217  True)
218 
219  def testFunctionalSiteDeleteBad1(self):
220  global fName
221  fName = "./save_pic/dcc_site_delete_bad1.json"
222  print("SITE DELETE BAD1 START >>> \n")
223  self.commonTestCode(["-cmd", "SITE_DELETE", "-f", "./jsons/dcc_site_delete_bad1.json", "--config", "./dcc.ini"],
224  False)
225 
226 
227  def testFunctionalSiteDeleteBad2(self):
228  global fName
229  fName = "./save_pic/dcc_site_delete_bad2.json"
230  print("SITE DELETE BAD2 START >>> \n")
231  self.commonTestCode(["-cmd", "SITE_DELETE", "-f", "./jsons/dcc_site_delete_bad2.json", "--config", "./dcc.ini"],
232  False)
233 
234 
235  def testFunctionalSiteDeleteOk(self):
236  global fName
237  fName = "./save_pic/dcc_site_delete_ok.json"
238  print("SITE DELETE OK START >>> \n")
239  self.commonTestCode(["-cmd", "SITE_DELETE", "-f", "./jsons/dcc_site_delete_ok.json", "--config", "./dcc.ini"],
240  True)
241 
242 
243  def testFunctionalSiteCleanupBad1(self):
244  global fName
245  fName = "./save_pic/dcc_site_cleanup_bad1.json"
246  print("SITE CLEANUP BAD1 START >>> \n")
247  self.commonTestCode(["-cmd", "SITE_CLEANUP", "-f", "./jsons/dcc_site_cleanup_bad1.json", "--config", "./dcc.ini"],
248  False)
249 
250 
251  def testFunctionalSiteCleanupBad2(self):
252  global fName
253  fName = "./save_pic/dcc_site_cleanup_bad2.json"
254  print("SITE CLEANUP BAD2 START >>> \n")
255  self.commonTestCode(["-cmd", "SITE_CLEANUP", "-f", "./jsons/dcc_site_cleanup_bad2.json", "--config", "./dcc.ini"],
256  False)
257 
258 
259  def testFunctionalSiteCleanupOk(self):
260  global fName
261  fName = "./save_pic/dcc_site_cleanup_ok.json"
262  print("SITE CLEANUP OK START >>> \n")
263  self.commonTestCode(["-cmd", "SITE_CLEANUP", "-f", "./jsons/dcc_site_cleanup_ok.json", "--config", "./dcc.ini"],
264  True)
265 
266 
267  def testFunctionalUrlNewBad1(self):
268  global fName
269  fName = "./save_pic/dcc_url_new_bad1.json"
270  print("URL NEW BAD1 START >>> \n")
271  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_bad1.json", "--config", "./dcc.ini"], False)
272 
273 
274  def testFunctionalUrlNewBad2(self):
275  global fName
276  fName = "./save_pic/dcc_url_new_bad2.json"
277  print("URL NEW BAD2 START >>> \n")
278  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_bad2.json", "--config", "./dcc.ini"], False)
279 
280 
281  def testFunctionalUrlNewOk(self):
282  global fName
283  fName = "./save_pic/dcc_url_new_ok.json"
284  print("URL NEW OK START >>> \n")
285  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_ok.json", "--config", "./dcc.ini"], True)
286 
287 
288  def testFunctionalUrlStatusBad1(self):
289  global fName
290  fName = "./save_pic/dcc_url_status_bad1.json"
291  print("URL STATUS BAD1 START >>> \n")
292  self.commonTestCode(["-cmd", "URL_STATUS", "-f", "./jsons/dcc_url_status_bad1.json", "--config", "./dcc.ini"],
293  False)
294 
295 
296  def testFunctionalUrlStatusBad2(self):
297  global fName
298  fName = "./save_pic/dcc_url_status_bad2.json"
299  print("URL STATUS BAD2 START >>> \n")
300  self.commonTestCode(["-cmd", "URL_STATUS", "-f", "./jsons/dcc_url_status_bad2.json", "--config", "./dcc.ini"],
301  False)
302 
303 
304  def testFunctionalUrlStatusOk(self):
305  global fName
306  fName = "./save_pic/dcc_url_status_ok.json"
307  print("URL STATUS OK START >>> \n")
308  self.commonTestCode(["-cmd", "URL_STATUS", "-f", "./jsons/dcc_url_status_ok.json", "--config", "./dcc.ini"], True)
309 
310 
311  def testFunctionalUrlUpdateBad1(self):
312  global fName
313  fName = "./save_pic/dcc_url_update_bad1.json"
314  print("URL UPDATE BAD1 START >>> \n")
315  self.commonTestCode(["-cmd", "URL_UPDATE", "-f", "./jsons/dcc_url_update_bad1.json", "--config", "./dcc.ini"],
316  False)
317 
318 
319  def testFunctionalUrlUpdateBad2(self):
320  global fName
321  fName = "./save_pic/dcc_url_update_bad2.json"
322  print("URL UPDATE BAD2 START >>> \n")
323  self.commonTestCode(["-cmd", "URL_UPDATE", "-f", "./jsons/dcc_url_update_bad2.json", "--config", "./dcc.ini"],
324  False)
325 
326 
327  def testFunctionalUrlUpdateBad3(self):
328  global fName
329  fName = "./save_pic/dcc_url_update_bad3.json"
330  print("URL UPDATE BAD3 START >>> \n")
331  self.commonTestCode(["-cmd", "URL_UPDATE", "-f", "./jsons/dcc_url_update_bad3.json", "--config", "./dcc.ini"],
332  False)
333 
334 
335  def testFunctionalUrlUpdateOk(self):
336  global fName
337  fName = "./save_pic/dcc_url_update_ok.json"
338  print("URL UPDATE OK START >>> \n")
339  self.commonTestCode(["-cmd", "URL_UPDATE", "-f", "./jsons/dcc_url_update_ok.json", "--config", "./dcc.ini"], True)
340 
341 
342  def testFunctionalUrlFetchBad1(self):
343  global fName
344  fName = "./save_pic/dcc_url_fetch_bad1.json"
345  print("URL FETCH BAD1 START >>> \n")
346  self.commonTestCode(["-cmd", "URL_FETCH", "-f", "./jsons/dcc_url_fetch_bad1.json", "--config", "./dcc.ini"], False)
347 
348 
349  def testFunctionalUrlFetchBad2(self):
350  global fName
351  fName = "./save_pic/dcc_url_fetch_bad2.json"
352  print("URL FETCH BAD2 START >>> \n")
353  self.commonTestCode(["-cmd", "URL_FETCH", "-f", "./jsons/dcc_url_fetch_bad2.json", "--config", "./dcc.ini"], False)
354 
355 
356  def testFunctionalUrlFetchBad3(self):
357  global fName
358  fName = "./save_pic/dcc_url_fetch_bad3.json"
359  print("URL FETCH BAD3 START >>> \n")
360  self.commonTestCode(["-cmd", "URL_FETCH", "-f", "./jsons/dcc_url_fetch_bad3.json", "--config", "./dcc.ini"], False)
361 
362 
363  def testFunctionalUrlFetchOk(self):
364  global fName
365  fName = "./save_pic/dcc_url_fetch_ok.json"
366  print("URL FETCH OK START >>> \n")
367  self.commonTestCode(["-cmd", "URL_FETCH", "-f", "./jsons/dcc_url_fetch_ok.json", "--config", "./dcc.ini"], True)
368 
369 
370  def testFunctionalUrlDeleteBad1(self):
371  global fName
372  fName = "./save_pic/dcc_url_delete_bad1.json"
373  print("URL DELETE BAD1 START >>> \n")
374  self.commonTestCode(["-cmd", "URL_DELETE", "-f", "./jsons/dcc_url_delete_bad1.json", "--config", "./dcc.ini"],
375  False)
376 
377 
378  def testFunctionalUrlDeleteBad2(self):
379  global fName
380  fName = "./save_pic/dcc_url_delete_bad2.json"
381  print("URL DELETE BAD2 START >>> \n")
382  self.commonTestCode(["-cmd", "URL_DELETE", "-f", "./jsons/dcc_url_delete_bad2.json", "--config", "./dcc.ini"],
383  False)
384 
385 
386  def testFunctionalUrlDeleteOk(self):
387  global fName
388  fName = "./save_pic/dcc_url_delete_ok.json"
389  print("URL DELETE OK START >>> \n")
390  self.commonTestCode(["-cmd", "URL_DELETE", "-f", "./jsons/dcc_url_delete_ok.json", "--config", "./dcc.ini"], True)
391 
392 
393  def testFunctionalUrlCleanupBad1(self):
394  global fName
395  fName = "./save_pic/dcc_url_cleanup_bad1.json"
396  print("URL CLEANUP BAD1 START >>> \n")
397  self.commonTestCode(["-cmd", "URL_CLEANUP", "-f", "./jsons/dcc_url_cleanup_bad1.json", "--config", "./dcc.ini"],
398  False)
399 
400 
401  def testFunctionalUrlCleanupBad2(self):
402  global fName
403  fName = "./save_pic/dcc_url_cleanup_bad2.json"
404  print("URL CLEANUP BAD2 START >>> \n")
405  self.commonTestCode(["-cmd", "URL_CLEANUP", "-f", "./jsons/dcc_url_cleanup_bad2.json", "--config", "./dcc.ini"],
406  False)
407 
408 
409  def testFunctionalUrlCleanupBad3(self):
410  global fName
411  fName = "./save_pic/dcc_url_cleanup_bad3.json"
412  print("URL CLEANUP BAD3 START >>> \n")
413  self.commonTestCode(["-cmd", "URL_CLEANUP", "-f", "./jsons/dcc_url_cleanup_bad3.json", "--config", "./dcc.ini"],
414  False)
415 
416 
417  def testFunctionalUrlCleanupOk(self):
418  global fName
419  fName = "./save_pic/dcc_url_cleanup_ok.json"
420  print("URL CLEANUP OK START >>> \n")
421  self.commonTestCode(["-cmd", "URL_CLEANUP", "-f", "./jsons/dcc_url_cleanup_ok.json", "--config", "./dcc.ini"],
422  True)
423 
424 
425  def testFunctionalUrlContentBad1(self):
426  global fName
427  fName = "./save_pic/dcc_url_content_bad1.json"
428  print("URL CONTENT BAD1 START >>> \n")
429  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_bad1.json", "--config", "./dcc.ini"],
430  False)
431 
432 
433  def testFunctionalUrlContentBad2(self):
434  global fName
435  fName = "./save_pic/dcc_url_content_bad2.json"
436  print("URL CONTENT BAD2 START >>> \n")
437  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_bad2.json", "--config", "./dcc.ini"],
438  False)
439 
440 
441  def testFunctionalUrlContentBad3(self):
442  global fName
443  fName = "./save_pic/dcc_url_content_bad3.json"
444  print("URL CONTENT BAD3 START >>> \n")
445  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_bad3.json", "--config", "./dcc.ini"],
446  False)
447 
448 
449  def testFunctionalUrlContentOk(self):
450  global fName
451  fName = "./save_pic/dcc_url_content_ok.json"
452  print("URL CONTENT TEST1 OK START >>> \n")
453  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_ok.json", "--config", "./dcc.ini"],
454  True)
455 
456 
457  def testFunctionalUrlContentOk1(self):
458  global fName
459  fName = "./save_pic/DCC_url_content1-4.json"
460  print("URL CONTENT TEST1 OK START >>> \n")
461  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/DCC_url_content1-4.json", "--config", "./dcc.ini"],
462  True)
463 
464 
465  def testFunctionalUrlContentOk2(self):
466  global fName
467  fName = "./save_pic/DCC_url_content5.json"
468  print("URL CONTENT TEST1 OK START >>> \n")
469  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/DCC_url_content5.json", "--config", "./dcc.ini"],
470  True)
471 
472 
473  def testFunctionalUrlContentOk3(self):
474  global fName
475  fName = "./save_pic/DCC_url_content5_dyn.json"
476  print("URL CONTENT TEST1 OK START >>> \n")
477  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/DCC_url_content5_dyn.json", "--config", "./dcc.ini"],
478  True)
479 
480 
481  def testFunctionalUrlContentOk4(self):
482  global fName
483  fName = "./save_pic/DCC_url_content5_ext.json"
484  print("URL CONTENT TEST1 OK START >>> \n")
485  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/DCC_url_content5_ext.json", "--config", "./dcc.ini"],
486  True)
487 
488 
489  def testFunctionalUrlContentOk5(self):
490  global fName
491  fName = "./save_pic/DCC_url_content_dbfields.json"
492  print("URL CONTENT TEST1 OK START >>> \n")
493  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/DCC_url_content_dbfields.json", "--config", "./dcc.ini"],
494  True)
495 
496 
497  def testFunctionalInvalidJSON(self):
498  global fName
499  fName = "./save_pic/dcc_invalid_json.json"
500  print("INVALID JSON START >>> \n")
501  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_invalid_json.json", "--config", "./dcc.ini"], False)
502 
503 
504  def testFunctionalUrlContentTestJSON(self):
505  global fName
506  fName = "./save_pic/dcc_url_content_test1.json"
507  print("CONTENT TEST JSON START >>> \n")
508  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_test1.json", \
509  "--config", "./dcc.ini", "--merge", "1"], False)
510 
511 
512  def testFunctionalCustomBad1JSON(self):
513  global fName
514  fName = "./save_pic/dcc_sql_custom_bad1.json"
515  print("CUSTOM BAD1 TEST JSON START >>> \n")
516  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_bad1.json", \
517  "--config", "./dcc.ini"], False)
518 
519 
520  def testFunctionalCustomBad2JSON(self):
521  global fName
522  fName = "./save_pic/dcc_sql_custom_bad2.json"
523  print("CUSTOM BAD2 TEST JSON START >>> \n")
524  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_bad2.json", \
525  "--config", "./dcc.ini"], False)
526 
527 
528  def testFunctionalCustomBad3JSON(self):
529  global fName
530  fName = "./save_pic/dcc_sql_custom_bad3.json"
531  print("CUSTOM BAD3 TEST JSON START >>> \n")
532  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_bad3.json", \
533  "--config", "./dcc.ini"], False)
534 
535 
536  def testFunctionalCustomBad4JSON(self):
537  global fName
538  fName = "./save_pic/dcc_sql_custom_bad4.json"
539  print("CUSTOM BAD4 TEST JSON START >>> \n")
540  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_bad4.json", \
541  "--config", "./dcc.ini"], False)
542 
543 
544  def testFunctionalCustomBad5JSON(self):
545  global fName
546  fName = "./save_pic/dcc_sql_custom_bad5.json"
547  print("CUSTOM BAD5 TEST JSON START >>> \n")
548  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_bad5.json", \
549  "--config", "./dcc.ini"], False)
550 
551 
552  def testFunctionalCustomBad6JSON(self):
553  global fName
554  fName = "./save_pic/dcc_sql_custom_bad6.json"
555  print("CUSTOM BAD6 TEST JSON START >>> \n")
556  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_bad6.json", \
557  "--config", "./dcc.ini"], False)
558 
559 
560  def testFunctionalCustomOkJSON(self):
561  global fName
562  fName = "./save_pic/dcc_sql_custom_ok.json"
563  print("CUSTOM OK TEST JSON START >>> \n")
564  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_ok.json", "--config", "./dcc.ini"], False)
565 
566 
567  def testFunctionalBatchOkJSON(self):
568  global fName
569  fName = "./save_pic/dcc_batch_ok.json"
570  print("BATCH OK TEST JSON START >>> \n")
571  self.commonTestCode(["-cmd", "BATCH", "-f", "./jsons/dcc_batch_ok.json", "--config", "./dcc.ini"], False)
572 
573 
574  def testFunctionalBatchPropOkJSON(self):
575  global fName
576  fName = "./save_pic/dcc_batch_prop_ok.json"
577  print("BATCH PROP OK TEST JSON START >>> \n")
578  self.commonTestCode(["-cmd", "BATCH", "-f", "./jsons/dcc_batch_prop_ok.json", "--config", "./dcc.ini"], True)
579 
580 
581  def testFunctionalSiteFindJSON(self):
582  global fName
583  fName = "./save_pic/dcc_site_find_ok.json"
584  print("SITE FIND OK TEST JSON START >>> \n")
585  self.commonTestCode(["-cmd", "SITE_FIND", "-f", "./jsons/dcc_site_find_ok.json", "--config", "./dcc.ini"], True)
586 
587 
588  def testFunctionalUrlPurgeBad1JSON(self):
589  global fName
590  fName = "./save_pic/dcc_url_purge_bad1.json"
591  print("URL PURGE BAD1 TEST JSON START >>> \n")
592  self.commonTestCode(["-cmd", "URL_PURGE", "-f", "./jsons/dcc_url_purge_bad1.json", "--config", "./dcc.ini"], False)
593 
594 
595  def testFunctionalUrlPurgeOkJSON(self):
596  global fName
597  fName = "./save_pic/dcc_url_purge_ok.json"
598  print("URL PURGE OK TEST JSON START >>> \n")
599  self.commonTestCode(["-cmd", "URL_PURGE", "-f", "./jsons/dcc_url_purge_ok.json", "--config", "./dcc.ini"], True)
600 
601 
602  def testFunctionalUrlPurgeOk2JSON(self):
603  global fName
604  fName = "./save_pic/dcc_url_purge_ok2.json"
605  print("URL PURGE OK2 TEST JSON START >>> \n")
606  self.commonTestCode(["-cmd", "URL_PURGE", "-f", "./jsons/dcc_url_purge_ok2.json", "--config", "./dcc.ini"], True)
607 
608 
609  def testFunctionalUrlPurgeOk3JSON(self):
610  global fName
611  fName = "./save_pic/dcc_url_purge_ok3.json"
612  print("URL PURGE OK3 TEST JSON START >>> \n")
613  self.commonTestCode(["-cmd", "URL_PURGE", "-f", "./jsons/dcc_url_purge_ok3.json", "--config", "./dcc.ini"], True)
614 
615 
616  def testFunctionalUrlNewDtest1OkJSON(self):
617  global fName
618  fName = "./save_pic/dcc_url_new_dtest1_ok.json"
619  print("URL DTEST1 OK2 TEST JSON START >>> \n")
620  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_dtest1_ok.json", "--config", "./dcc.ini"], True)
621 
622 
623  def testFunctionalFieldRecalculatorOkJSON(self):
624  global fName
625  fName = "./save_pic/dcc_field_recalculator_ok.json"
626  print("URL FIELD RECALCULATOR TEST JSON START >>> \n")
627  self.commonTestCode(["-cmd", "F_RECALC", "-f", "./jsons/dcc_field_recalculator_ok.json", "--config", "./dcc.ini"],
628  True)
629 
630 
631  def testFunctionalURLNewVerify1JSON(self):
632  global fName
633  fName = "./save_pic/dcc_url_new_verify.json"
634  print("URL NEW VERIFY TEST JSON START >>> \n")
635  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_verify.json", "--config", "./dcc.ini"],
636  True)
637 
638 
639  def testFunctionalURLNewVerify21JSON(self):
640  global fName
641  fName = "./save_pic/dcc_url_new_verify2.json"
642  print("URL NEW VERIFY2 TEST JSON START >>> \n")
643  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_verify2.json", "--config", "./dcc.ini"],
644  True)
645 
646 
647  def testFunctionalURLVerify1JSON(self):
648  global fName
649  fName = "./save_pic/dcc_url_verify.json"
650  print("URL VERIFY TEST JSON START >>> \n")
651  self.commonTestCode(["-cmd", "URL_VERIFY", "-f", "./jsons/dcc_url_verify.json", "--config", "./dcc.ini"],
652  True)
653 
654 
655  def testFunctionalURLNewUpdate(self):
656  global fName
657  fName = "./save_pic/dcc_url_new_update_ok.json"
658  print("URL NEW UPDATE TEST JSON START >>> \n")
659  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_update_ok.json", "--config", "./dcc.ini"],
660  True)
661 
662 
663  def testFunctionalURLAge(self):
664  global fName
665  fName = "./save_pic/dcc_url_age_ok.json"
666  print("URL AGE TEST JSON START >>> \n")
667  self.commonTestCode(["-cmd", "URL_AGE", "-f", "./jsons/dcc_url_age_ok.json", "--config", "./dcc.ini"],
668  True)
669 
670 
671  def testFunctionalSiteNewContentOk(self):
672  global fName
673  fName = "./save_pic/dcc_site_ok_current.json"
674  print("SITE NEW CONTENT OK START >>> \n")
675  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_ok_current.json", "--config", "./dcc.ini"], True)
676 
677 
678  def testFunctionalCustomContentOkJSON(self):
679  global fName
680  fName = "./save_pic/dcc_sql_custom_content.json"
681  print("CUSTOM CONTENT OK TEST JSON START >>> \n")
682  self.commonTestCode(["-cmd", "SQL_CUSTOM", "-f", "./jsons/dcc_sql_custom_content.json", "--config", "./dcc.ini"],
683  True)
684 
685 
686  def testFunctionalUrlContentOkMySQLself(self):
687  global fName
688  fName = "./save_pic/dcc_url_content_mysql.json"
689  print("URL CONTENT TEST1 OK START >>> \n")
690  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_mysql.json", "--config", "./dcc.ini"],
691  True)
692 
693 
694  def testFunctionalSiteNewOkTest(self):
695  global fName
696  fName = "./save_pic/dcc_site_new_test.json"
697  print("SITE NEW TEST OK START >>> \n")
698  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_test.json", "--config", "./dcc.ini"],
699  True)
700 
701 
702  def testFunctionalUrlPutOkTest(self):
703  global fName
704  fName = "./save_pic/dcc_url_put.json"
705  print("URL PUT TEST OK START >>> \n")
706  self.commonTestCode(["-cmd", "URL_PUT", "-f", "./jsons/dcc_url_put.json", "--config", "./dcc.ini"],
707  True)
708 
709 
710  def testFunctionalSiteNewOkTest(self):
711  global fName
712  fName = "./save_pic/dcc_site_new_move.json"
713  print("SITE NEW MOVE OK START >>> \n")
714  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_move_ok.json", "--config", "./dcc.ini"],
715  True)
716 
717 
718  def testFunctionalSiteCleanupOkTest(self):
719  global fName
720  fName = "./save_pic/dcc_site_cleanup_move_ok.json"
721  print("SITE CLEANUP MOVE OK START >>> \n")
722  self.commonTestCode(["-cmd", "SITE_CLEANUP", "-f", "./jsons/dcc_site_cleanup_move_ok.json", "--config", "./dcc.ini"],
723  True)
724 
725 
726  def testFunctionalUrlNewMoveOkTest(self):
727  global fName
728  fName = "./save_pic/dcc_url_new_move_ok.json"
729  print("URL NEW MOVE OK START >>> \n")
730  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_move_ok.json", "--config", "./dcc.ini"],
731  True)
732 
733 
734  def testFunctionalSiteNewDefCriterionsOkTest(self):
735  global fName
736  fName = "./save_pic/dcc_site_new_def_recalc_ok.json"
737  print("SITE NEW DEF CRITERIONS TEST OK START >>> \n")
738  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_def_recalc_ok.json", "--config", "./dcc.ini"],
739  True)
740 
741 
742  def testFunctionalFieldRecalculatorDefOkJSON(self):
743  global fName
744  fName = "./save_pic/dcc_field_recalculator_def_ok.json"
745  print("URL FIELD RECALCULATOR DEF TEST JSON START >>> \n")
746  self.commonTestCode(["-cmd", "F_RECALC", "-f", "./jsons/dcc_field_recalculator_def_ok.json",
747  "--config", "./dcc.ini"], True)
748 
749 
750  def testFunctionalSiteNewOkTest(self):
751  global fName
752  fName = "./save_pic/dcc_site_new_filters.json"
753  print("SITE NEW FILTERS TEST OK START >>> \n")
754  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/dcc_site_new_filters.json", "--config", "./dcc.ini"],
755  True)
756 
757 
758  def testFunctionalUrlNewOkTest(self):
759  global fName
760  fName = "./save_pic/dcc_url_new_statistic_ok.json"
761  print("URL NEW STATISTIC TEST OK START >>> \n")
762  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_statistic_ok.json", "--config", "./dcc.ini"],
763  True)
764 
765 
766  def testFunctionalUrlUpdateOkTest(self):
767  global fName
768  fName = "./save_pic/dcc_url_update_statistic_ok.json"
769  print("URL UPDATE STATISTIC TEST OK START >>> \n")
770  self.commonTestCode(["-cmd", "URL_UPDATE", "-f", "./jsons/dcc_url_update_statistic_ok.json", "--config",
771  "./dcc.ini"], True)
772 
773 
774  def testFunctionalUrlDeleteOkTest(self):
775  global fName
776  fName = "./save_pic/dcc_url_delete_statistic_ok.json"
777  print("URL DELETE STATISTIC TEST OK START >>> \n")
778  self.commonTestCode(["-cmd", "URL_DELETE", "-f", "./jsons/dcc_url_delete_statistic_ok.json", "--config",
779  "./dcc.ini"], True)
780 
781 
782  def testFunctionalURLAge(self):
783  global fName
784  fName = "./save_pic/dcc_url_age_statistic_ok.json"
785  print("URL AGE STATISTIC TEST JSON START >>> \n")
786  self.commonTestCode(["-cmd", "URL_AGE", "-f", "./jsons/dcc_url_age_statistic_ok.json", "--config", "./dcc.ini"],
787  True)
788 
789 
790  def testFunctionalUrlPurge(self):
791  global fName
792  fName = "./save_pic/dcc_url_purge_statistic_ok.json"
793  print("URL PURGE STATISTIC TEST JSON START >>> \n")
794  self.commonTestCode(["-cmd", "URL_PURGE", "-f", "./jsons/dcc_url_purge_statistic_ok.json", "--config",
795  "./dcc.ini"], True)
796 
797  def testFunctionalUrlNewPutOk(self):
798  global fName
799  fName = "./save_pic/dcc_url_new_put_ok.json"
800  print("URL NEW PUT OK START >>> \n")
801  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/dcc_url_new_put_ok.josn", "--config", "./dcc.ini"], True)
802 
803 
804  def testFunctionalUrlUpdatePutOk(self):
805  global fName
806  fName = "./save_pic/dcc_url_update_put_ok.json"
807  print("URL UPDATE PUT OK START >>> \n")
808  self.commonTestCode(["-cmd", "URL_UPDATE", "-f", "./jsons/dcc_url_update_put_ok.json", "--config", "./dcc.ini"],
809  True)
810 
811 
812  def testFunctionalUrlContentTest2Ok(self):
813  global fName
814  fName = "./save_pic/dcc_url_content_test2.json"
815  print("URL CONTENT TEST2 OK START >>> \n")
816  self.commonTestCode(["-cmd", "URL_CONTENT", "-f", "./jsons/dcc_url_content_test2.json", "--config", "./dcc.ini"],
817  True)
818  '''
819  '''
820  def testFunctionalSiteNewOkTest(self):
821  global fName
822  fName = "./save_pic/dcc_site_new_ok.json"
823  print("SITE NEW OK START >>> \n")
824  self.commonTestCode(["-cmd", "SITE_NEW", "-f", "./jsons/DC-770/dcc_site_new_ok.json", "--config", "./dcc.ini"],
825  True)
826 
827 
828  def testFunctionalUrlNewOk(self):
829  global fName
830  fName = "./save_pic/dcc_url_new_ok.json"
831  print("URL NEW OK START >>> \n")
832  self.commonTestCode(["-cmd", "URL_NEW", "-f", "./jsons/DC-766/dcc_url_new_ok.json", "--config", "./dcc.ini"], True)
833 
834 
835  def testFunctionalSiteUpdateOk(self):
836  global fName
837  fName = "./save_pic/dcc_site_update_ok.json"
838  print("SITE UPDATE OK START >>> \n")
839  self.commonTestCode(["-cmd", "SITE_UPDATE", "-f", "./jsons/DC-770/dcc_site_update_ok.json", "--config", "./dcc.ini"],
840  True)
841 
842 
843  def testFunctionalUrlPutOkTest(self):
844  global fName
845  fName = "./save_pic/dcc_url_put_test.json"
846  print("URL PUT TEST OK START >>> \n")
847  self.commonTestCode(["-cmd", "URL_PUT", "-f", "./jsons/dcc_url_put_test.json", "--config", "./dcc.ini"],
848  True)
849  '''
850 
851 if __name__ == "__main__":
852  #import sys;sys.argv = ['', 'Test.testName']
853  unittest.main()
def testFunctionalSiteNewOk(self)
Definition: ftest_DCC.py:128
def connectionBuilderMockBuild(type, addr, networkType)
Definition: ftest_DCC.py:73
def commonTestCode(self, args, isSave)
Definition: ftest_DCC.py:89
Definition: DCC.py:1
def poll(self, timeout)
Definition: ftest_DCC.py:55