Esempio n. 1
0
    def __init__(self):
        super().__init__()

        for name in ('oh_post_update', 'oh_send_command'):
            for k in get_openhab_test_types():
                if name == 'oh_send_command' and k == 'Contact':
                    continue
                self.add_test(f'{k}.{name}', self.test_func, k, name, get_openhab_test_states(k))
    def __init__(self):
        super().__init__()

        # test the states
        for oh_type in get_openhab_test_types():
            self.add_test(f'{oh_type} events', self.test_events, oh_type, get_openhab_test_events(oh_type))

        for dimension in ITEM_DIMENSIONS:
            self.add_test(f'Quantity {dimension} events', self.test_quantity_type_events, dimension)
Esempio n. 3
0
    def test_item_create_delete(self):
        test_defs = []
        for type in get_openhab_test_types():
            test_defs.append((type, get_random_name(type)))
        test_defs.append(('Number', 'HABApp_Ping'))

        for item_type, item_name in test_defs:
            assert not self.openhab.item_exists(item_name)

            self.openhab.create_item(item_type, item_name)
            assert self.openhab.item_exists(item_name)

            self.openhab.remove_item(item_name)
            assert not self.openhab.item_exists(item_name)
Esempio n. 4
0
    def __init__(self):
        super().__init__()

        self.add_test('Interface item exists', self.test_item_exists)
        self.add_test('Interface item create/remove',
                      self.test_item_create_delete)
        self.add_test('Interface group create/remove',
                      self.test_item_create_delete_group)
        self.add_test('Interface get item definition',
                      self.test_item_definition)

        # test the states
        for oh_type in get_openhab_test_types():
            self.add_test(f'post_update {oh_type}', self.test_post_update,
                          oh_type, get_openhab_test_states(oh_type))

        # test json post
        self.add_test(f'post_update (by_json)', self.test_umlaute)
        self.add_test(f'test_item_not_found', self.test_openhab_item_not_found)
        self.add_test(f'Interface Metadata', self.test_metadata)