class TestMyTarget:
    @pytest.fixture(scope='function', autouse=True)
    def setup(self):
        self.client = MyTargetClient()

    def test_segment_creating(self):
        segment_ids_before = self.client.get_all_segments_ids()
        segment_id = self.client.create_segment()
        segment_ids_after = self.client.get_all_segments_ids()
        assert (segment_id
                not in segment_ids_before) and (segment_id
                                                in segment_ids_after)
        self.client.delete_segment(segment_id=segment_id)

    def test_segment_deleting(self):
        segment_id = self.client.create_segment()
        segment_ids_before = self.client.get_all_segments_ids()
        self.client.delete_segment(segment_id=segment_id)
        segment_ids_after = self.client.get_all_segments_ids()
        assert (segment_id
                in segment_ids_before) and (segment_id
                                            not in segment_ids_after)
Esempio n. 2
0
def api_client(email, password):
    return MyTargetClient(email, password)
Esempio n. 3
0
 def api_client(self):
     return MyTargetClient(os.getenv("MYTARGET_USER"),
                           os.getenv("MYTARGET_PASSWORD"))
Esempio n. 4
0
    def api_client(self):
        user = '******'
        password = '******'

        return MyTargetClient(user, password)
Esempio n. 5
0
def mytarget_client(config):
    return MyTargetClient(config)
 def api_client(self):
     email = '*****@*****.**'
     password = '******'
     return MyTargetClient(email, password)
 def setup(self):
     self.client = MyTargetClient()