예제 #1
0
    def test_service_get_all_by_host(self):
        values = [
            {'host': 'host1', 'topic': 't1'},
            {'host': 'host1', 'topic': 't1'},
            {'host': 'host2', 'topic': 't1'},
            {'host': 'host3', 'topic': 't2'}
        ]
        services = [self._create_service(vals) for vals in values]

        expected = services[:2]
        real = db.service_get_all_by_host(self.ctxt, 'host1')
        self._assertEqualListsOfObjects(expected, real)
예제 #2
0
    def test_service_get_all_by_host(self):
        values = [
            {"host": "host1", "topic": "t1"},
            {"host": "host1", "topic": "t1"},
            {"host": "host2", "topic": "t1"},
            {"host": "host3", "topic": "t2"},
        ]
        services = [self._create_service(vals) for vals in values]

        expected = services[:2]
        real = db.service_get_all_by_host(self.ctxt, "host1")
        self._assertEqualListsOfObjects(expected, real)