def test_list_clusters(self):
        # list clusters successfully

        url = '/clusters'
        return_value = self.test_client.get(url)
        self.assertEqual(return_value.status_code, 200)
        resp = json.loads(return_value.get_data())
        expected = [
            {'name': 'test_cluster1'},
            {'name': 'test_cluster2'}
        ]
        for i, v in enumerate(resp):
            self.assertTrue(
                all(item in resp[i].items() for item in expected[i].items())
            )

        # give a non-existed
        url = '/clusters?name=xx'
        return_value = json.loads(
            self.test_client.get(url).get_data()
        )
        self.assertEqual([], return_value)
dataset/ETHPy150Open openstack/compass-core/compass/tests/api/test_api.py/TestClusterAPI.test_list_clusters/original