test_api_domains.py 504 B

12345678910111213
  1. from conftest import DeSECAPIV1Client, random_domainname
  2. def test_create(api_user: DeSECAPIV1Client):
  3. assert len(api_user.domain_list()) == 0
  4. assert api_user.domain_create(random_domainname()).status_code == 201
  5. assert len(api_user.domain_list()) == 1
  6. def test_destroy(api_user_domain: DeSECAPIV1Client):
  7. n = len(api_user_domain.domain_list())
  8. assert api_user_domain.domain_destroy(api_user_domain.domain).status_code == 204
  9. assert len(api_user_domain.domain_list()) == n - 1