Ejemplo n.º 1
0
    def test__methods_of_with_class(self):
        class fake_class(object):
            def public(self):
                pass

            def _private(self):
                pass
        result = cliutils._methods_of(fake_class)
        self.assertEqual(1, len(result))
        self.assertEqual("public", result[0][0])
Ejemplo n.º 2
0
    def test__methods_of_empty_result(self):
        class fake_class(object):
            def _private(self):
                pass

            def _private2(self):
                pass
        mock_obj = fake_class()
        result = cliutils._methods_of(mock_obj)
        self.assertEqual(result, [])
Ejemplo n.º 3
0
    def test__methods_of_empty_result(self):
        class fake_class(object):
            def _private(self):
                pass

            def _private2(self):
                pass

        mock_obj = fake_class()
        result = cliutils._methods_of(mock_obj)
        self.assertEqual(result, [])
Ejemplo n.º 4
0
    def test__methods_of_with_class(self):
        class fake_class(object):
            def public(self):
                pass

            def _private(self):
                pass

        result = cliutils._methods_of(fake_class)
        self.assertEqual(1, len(result))
        self.assertEqual("public", result[0][0])
Ejemplo n.º 5
0
    def test__methods_of_empty_result(self):
        class fake_class():
            pass

        def public_callable(self):
            pass

        def _private_callable(self):
            pass

        mock_obj = fake_class()
        mock_obj._private = _private_callable
        mock_obj._private2 = public_callable
        result = cliutils._methods_of(mock_obj)
        self.assertEqual(result, [])
Ejemplo n.º 6
0
    def test__methods_of_works(self):
        class fake_class(object):
            pass

        def public_callable(self):
            pass

        def _private_callable(self):
            pass
        mock_obj = fake_class()
        mock_obj.public = public_callable
        mock_obj._private = _private_callable
        result = cliutils._methods_of(mock_obj)
        self.assertEqual(1, len(result))
        self.assertEqual("public", result[0][0])