Example #1
0
    def test_forbid_private_methods(self):
        """Test that we can't call private class methods (those starting with '_')"""
        s = Server('http://host-doesnt-exist')
        with self.assertRaises(AttributeError):
            s._foo()

        # nested private method call
        with self.assertRaises(AttributeError):
            s.foo.bar._baz()
Example #2
0
    def test_forbid_private_methods(self):
        """Test that we can't call private class methods (those starting with '_')"""
        s = Server('http://host-doesnt-exist')
        with self.assertRaises(AttributeError):
            s._foo()

        # nested private method call
        with self.assertRaises(AttributeError):
            s.foo.bar._baz()