Exemplo n.º 1
0
    def test_enumerate_none(self):
        class Iface:
            pass

        class ExampleClient(Iface):
            pass

        methods = list(thrift._enumerate_service_methods(ExampleClient))

        self.assertEqual(methods, [])
Exemplo n.º 2
0
    def test_enumerate_none(self):
        class Iface(object):
            pass

        class ExampleClient(Iface):
            pass

        methods = list(thrift._enumerate_service_methods(ExampleClient))

        self.assertEqual(methods, [])
Exemplo n.º 3
0
    def test_inherited(self):
        class Iface:
            def local_method(self):
                pass

        class ExampleClient(BaseplateService.Client, Iface):
            pass

        methods = list(thrift._enumerate_service_methods(ExampleClient))

        self.assertEqual(set(methods), {"is_healthy", "local_method"})
Exemplo n.º 4
0
    def test_enumerate_some(self):
        class Iface:
            def some_method(self):
                pass

        class ExampleClient(Iface):
            pass

        methods = list(thrift._enumerate_service_methods(ExampleClient))

        self.assertEqual(set(methods), {"some_method"})
Exemplo n.º 5
0
    def test_inherited(self):
        class Iface(object):
            def local_method(self):
                pass

        class ExampleClient(BaseplateService.Client, Iface):
            pass

        methods = list(thrift._enumerate_service_methods(ExampleClient))

        self.assertEqual(set(methods), {"is_healthy", "local_method"})
Exemplo n.º 6
0
    def test_enumerate_some(self):
        class Iface(object):
            def some_method(self):
                pass

        class ExampleClient(Iface):
            pass

        methods = list(thrift._enumerate_service_methods(ExampleClient))

        self.assertEqual(set(methods), {"some_method"})
Exemplo n.º 7
0
    def test_not_subclass_of_iface(self):
        class ExampleClient:
            pass

        with self.assertRaises(AssertionError):
            list(thrift._enumerate_service_methods(ExampleClient))
Exemplo n.º 8
0
    def test_not_subclass_of_iface(self):
        class ExampleClient(object):
            pass

        with self.assertRaises(AssertionError):
            list(thrift._enumerate_service_methods(ExampleClient))