-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_api.py
34 lines (26 loc) · 1.09 KB
/
test_api.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import pytest
from base import BaseApi
from generators.campaing_json_generator import CampaingJson
class TestCampaing(BaseApi):
@pytest.mark.API
def test_campaign_create(self, repo_root):
"""Checking Campaign Creation and Deletion"""
campaign_json = CampaingJson(*self.upload_file_banner(
'files/campaign/240x400.png', repo_root
)).build()
id_campaign = self.create_campaign(campaign_json)
self.check_campaign(id_campaign, 'active')
self.delete_campaign_by_id(id_campaign)
class TestSegments(BaseApi):
@pytest.mark.API
def test_segments_create(self, default_segments_json):
"""Checking Segment Creation"""
id_segment = self.create_segment(default_segments_json)
self.check_segment(id_segment)
self.delete_segment_by_id(id_segment)
@pytest.mark.API
def test_segment_delete(self, default_segments_json):
"""Checking Segment Deletion"""
id_segment = self.create_segment(default_segments_json)
self.delete_segment_by_id(id_segment)
self.check_segment(id_segment, True)