File: test_events.py

package info (click to toggle)
pychurchtools 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 408 kB
  • sloc: python: 2,060; makefile: 4
file content (32 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download
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
from __future__ import annotations

from tests import get_ct_client


class TestEvents:
    @classmethod
    def setup_class(cls):
        cls.ct = get_ct_client()
        cls.events = cls.ct.events.get_all()

    def test_list(self):
        assert self.ct.events.get_all(include="eventServices")

    def test_get(self):
        assert self.events and len(self.events) > 0
        assert self.ct.events.get(self.events[0].id)

    def test_agenda(self):
        # TODO: find an event with agenda more reliably
        next_services = [evt for evt in self.events if "Gottesdienst" in evt.name]
        assert len(next_services) > 0
        assert self.ct.events.agenda(next_services[0].id)

    def test_songs(self):
        # TODO: find an event with songs more reliably
        next_services = [evt for evt in self.events if "Gottesdienst" in evt.name]
        assert len(next_services) > 0
        assert self.ct.events.songs(next_services[0].id)

    def test_masterdata(self):
        assert self.ct.events.masterdata()