How to use test_delete_domain method in tempest

Best Python code snippet using tempest_python

cdn_sample.py

Source:cdn_sample.py Github

copy

Full Screen

...38 {'peer': '1.2.3.4'}39 ]40 response = c.create_domain('opencdn3.sys-qa.com', origin)41 print(response)42def test_delete_domain(c):43 """44 test_delete_domain45 """46 response = c.delete_domain('opencdn3.sys-qa.com')47 print(response)48def test_enable_domain(c):49 """50 test_enable_domain51 """52 response = c.enable_domain('opencdn3.sys-qa.com')53 print(response)54def test_disable_domain(c):55 """56 test_disable_domain57 """58 response = c.disable_domain('opencdn3.sys-qa.com')59 print(response)60def test_get_domain_config(c):61 """62 test_get_domain_config63 """64 response = c.get_domain_config('opencdn3.sys-qa.com')65 print(response)66def test_set_domain_origin(c):67 """68 test_set_domain_origin69 """70 origin = [71 {'peer': '1.2.3.4', 'host': 'www.origin_host.com'},72 {'peer': '1.2.3.5', 'host': 'www.origin_host.com'}73 ]74 response = c.set_domain_origin('opencdn3.sys-qa.com', origin)75 print(response)76def test_get_domain_cache_ttl(c):77 """78 test_get_domain_cache_ttl79 """80 response = c.get_domain_cache_ttl('opencdn3.sys-qa.com')81 print(response)82def test_set_domain_cache_ttl(c):83 """84 test_set_domain_cache_ttl85 """86 rules = []87 rules.append({'type':'suffix', 'value': '.jpg', 'ttl': 3600, 'weight': 30})88 rules.append({'type':'path', 'value': '/a/b/c', 'ttl': 1800, 'weight': 15})89 response = c.set_domain_cache_ttl('opencdn3.sys-qa.com', rules)90 print(response)91def test_set_domain_cache_full_url(c):92 """93 test_set_domain_cache_full_url94 """95 response = c.set_domain_cache_full_url('opencdn3.sys-qa.com', False)96 print(response)97def test_set_domain_referer_acl(c):98 """99 test_set_domain_referer_acl100 """101 blackList = ["http://a/b/c/", "http://c/d/e/"]102 response = c.set_domain_referer_acl(103 domain = 'opencdn3.sys-qa.com',104 blackList = blackList,105 allowEmpty = True)106 print(response)107def test_set_domain_ip_acl(c):108 """109 test_set_domain_ip_acl110 """111 blackList = ['1.1.1.2', '1.1.1.3']112 response = c.set_domain_ip_acl(113 domain = 'opencdn3.sys-qa.com',114 blackList = blackList)115 print(response)116def test_set_domain_limit_rate(c):117 """118 test_set_domain_limit_rate119 """120 limitRate = 1024121 response = c.set_domain_limit_rate('opencdn3.sys-qa.com', limitRate)122 print(response)123def test_get_domain_pv_stat(c):124 """125 use new stat api126 params is optional127 no domain->all domains by uid128 no endTime->time by now129 no startTime->24hour before endTime130 no period->3600131 no withRegion->false132 """133 response = c.get_domain_pv_stat(134 domain = 'opencdn3.sys-qa.com',135 startTime = '2018-01-11T12:00:00Z',136 endTime = '2018-01-11T13:00:00Z',137 period = 3600, withRegion = '')138 print(response)139def test_get_domain_flow_stat(c):140 """141 use new stat api142 params is optional143 no domain->all domains by uid144 no endTime->time by now145 no startTime->24hour before endTime146 no period->3600147 no withRegion->false148 """149 response = c.get_domain_flow_stat(150 domain = 'opencdn3.sys-qa.com',151 startTime = '2018-01-11T12:00:00Z',152 endTime = '2018-01-11T13:00:00Z',153 period = 3600, withRegion = '')154 print(response)155def test_get_domain_src_flow_stat(c):156 """157 use new stat api158 params is optional159 no domain->all domains by uid160 no endTime->time by now161 no startTime->24hour before endTime162 no period->3600163 """164 response = c.get_domain_src_flow_stat(165 domain = 'opencdn3.sys-qa.com',166 startTime = '2018-01-11T12:00:00Z',167 endTime = '2018-01-11T13:00:00Z',168 period = 3600)169 print(response)170def test_get_domain_hitrate_stat(c):171 """172 use new stat api173 params is optional174 """175 response = c.get_domain_hitrate_stat(176 domain = 'opencdn3.sys-qa.com',177 startTime = '2018-01-11T12:00:00Z',178 endTime = '2018-01-11T13:00:00Z',179 period = 3600)180 print(response)181def test_get_domain_httpcode_stat(c):182 """183 use new stat api184 params is optional185 """186 response = c.get_domain_httpcode_stat(187 domain = 'opencdn3.sys-qa.com',188 startTime = '2018-01-11T12:00:00Z',189 endTime = '2018-01-11T13:00:00Z',190 period = 3600)191 print(response)192def test_get_domain_tpon_url_stat(c):193 """194 use new stat api195 params is optional196 """197 response = c.get_domain_topn_url_stat(198 domain = 'opencdn3.sys-qa.com',199 startTime = '2018-01-11T12:00:00Z',200 endTime = '2018-01-11T14:00:00Z',201 period = 3600)202 print(response)203def test_get_domain_topn_referer_stat(c):204 """205 use new stat api206 params is optional207 """208 response = c.get_domain_topn_referer_stat(209 domain = 'opencdn3.sys-qa.com',210 startTime = '2018-01-11T12:00:00Z',211 endTime = '2018-01-11T14:00:00Z',212 period = 3600)213 print(response)214def test_get_domain_uv_stat(c):215 """216 use new stat api217 params is optional218 """219 response = c.get_domain_uv_stat(220 domain = 'opencdn3.sys-qa.com',221 startTime = '2018-01-11T12:00:00Z',222 endTime = '2018-01-11T14:00:00Z',223 period = 3600)224 print(response)225def test_get_domain_avg_speed_stat(c):226 """227 use new stat api228 params is optional229 no domain->all domains by uid230 no endTime->time by now231 no startTime->24hour before endTime232 no period->3600233 no withDistribution->false234 """235 response = c.get_domain_avg_speed_stat(236 domain = 'opencdn3.sys-qa.com',237 startTime = '2018-01-11T12:00:00Z',238 endTime = '2018-01-11T13:00:00Z',239 period = 3600)240 print(response)241def test_purge(c):242 """243 test_purge244 """245 tasks = []246 tasks.append({'url': 'http://opencdn3.sys-qa.com/1.jpg'})247 tasks.append({'url': 'http://opencdn3.sys-qa.com/', "type":"directory"})248 response = c.purge(tasks)249 print(response)250def test_list_purge_tasks(c):251 """252 test_list_purge_tasks253 """254 response = c.list_purge_tasks(255 id = 'cb8eb1cf-b257-4426-8ac8-59c47b19a351',256 url = 'http://opencdn3.sys-qa.com/1.jpg',257 startTime = '2018-01-11T11:00:00Z',258 endTime = '2018-01-11T12:50:00Z'259 )260 print(response)261def test_prefetch(c):262 """263 test_prefetch264 """265 tasks = []266 tasks.append({'url': 'http://opencdn3.sys-qa.com/1.jpg'})267 tasks.append({'url': 'http://opencdn3.sys-qa.com/2.jpg'})268 response = c.prefetch(tasks)269 print(response)270def test_list_prefetch_tasks(c):271 """272 test_list_prefetch_tasks273 """274 response = c.list_prefetch_tasks(275 id = 'eJwzNDLXMTSyAAAFfAFi',276 startTime = '2018-01-11T11:00:00Z',277 endTime = '2018-01-11T12:50:00Z'278 )279 print(response)280def test_get_quota(c):281 """282 test_get_quota283 """284 response = c.list_quota()285 print(response)286def test_get_domain_log(c):287 """288 test_get_domain_log289 """290 response = c.get_domain_log(291 domain = 'opencdn3.sys-qa.com',292 startTime = '2018-01-11T10:00:00Z',293 endTime = '2018-01-11T12:50:00Z')294 print(response)295def test_ip_query(c):296 """297 test_ip_query298 """299 response = c.ip_query(action = 'describeIp', ip = '221.195.34.1')300 print(response)301if __name__ == "__main__":302 import logging303 logging.basicConfig(level=logging.INFO)304 __logger = logging.getLogger(__name__)305 c = CdnClient(cdn_sample_conf.config)306 # test_list_domains(c)307 # test_create_domain(c)308 # test_delete_domain(c)309 # test_enable_domain(c)310 # test_disable_domain(c)311 # test_get_domain_config(c)312 # test_set_domain_origin(c)313 # test_get_domain_cache_ttl(c)314 # test_set_domain_cache_ttl(c)315 # test_set_domain_cache_full_url(c)316 # test_set_domain_referer_acl(c)317 # test_set_domain_ip_acl(c)318 # test_set_domain_limit_rate(c)319 # test_get_domain_pv_stat(c)320 # test_get_domain_flow_stat(c)321 # test_get_domain_src_flow_stat(c)322 # test_get_domain_hitrate_stat(c)...

Full Screen

Full Screen

test_domains_api.py

Source:test_domains_api.py Github

copy

Full Screen

...24 Test case for add_domain25 Create new domain26 """27 pass28 def test_delete_domain(self):29 """30 Test case for delete_domain31 Deletes a domain32 """33 pass34 def test_get_domain_by_id(self):35 """36 Test case for get_domain_by_id37 Find domain by ID38 """39 pass40 def test_get_domain_by_name(self):41 """42 Test case for get_domain_by_name...

Full Screen

Full Screen

test_procesing_url.py

Source:test_procesing_url.py Github

copy

Full Screen

1from imagetotext import build_url_path2def test_delete_domain():3 input_ = 'youtube.com/jksfgksfgk'4 desired_output = '/jksfgksfgk'5 match = 'youtube.com'6 actual_output = build_url_path(input_, match)7 assert actual_output == desired_output8def test_delete_reddit_domain():9 input_ = 'oldsedditcom/1/LivestreamFail/'10 desired_output = 'LivestreamFail/'11 match = 'old.reddit.com/r/'12 actual_output = build_url_path(input_, match)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run tempest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful