Skip to content

Commit 5a379e4

Browse files
committed
default for hideAttributes to true
1 parent dc30b78 commit 5a379e4

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

python/debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
python-fastrpc (5.0.7) testing; urgency=low
2+
3+
* change default value of hideAttributes to true
4+
5+
-- Tomas Kral <tomas.kral@firma.seznam.cz> Mon, 23 Mar 2015 10:01:20 +0100
6+
17
python-fastrpc (5.0.6) testing; urgency=low
28

39
* ServerProxy(hideAttributes=true/false) possibility: calling fastrpc

python/fastrpcmodule.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,7 +1466,7 @@ PyObject* ServerProxy_ServerProxy(ServerProxyObject *, PyObject *args,
14661466
PyObject *datetimeBuilder = 0;
14671467
PyObject *preCall = 0;
14681468
PyObject *postCall = 0;
1469-
int hideAttributes = false;
1469+
int hideAttributes = true;
14701470

14711471
static const char *kwtypes = "siiiiisissiiOO";
14721472
const void *kwvars[] = { serverUrl, &readTimeout,

python/test/serverproxytest.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def setUp(self):
1818
def test_getattr(self):
1919
client = fastrpc.ServerProxy(
2020
self.url, readTimeout=1000, writeTimeout=1000, connectTimeout=1000,
21-
useBinary=fastrpc.ON_SUPPORT_ON_KEEP_ALIVE)
21+
useBinary=fastrpc.ON_SUPPORT_ON_KEEP_ALIVE, hideAttributes=False)
2222

2323
for attr in self.attributes_names:
2424
self.assertEqual(getattr(client, attr), getattr(self, attr))
@@ -28,7 +28,7 @@ def test_hideAttibutes(self):
2828
If hideAttributes parametr is set to True in constructor of ServerProxy
2929
all serverproxy attrs should be taken as frpc call attempt (proxy.url(), proxy.path()...)
3030
"""
31-
without_hide = fastrpc.ServerProxy(
31+
default_hide = fastrpc.ServerProxy(
3232
self.url, readTimeout=1, writeTimeout=1, connectTimeout=1,
3333
useBinary=fastrpc.ON_SUPPORT_ON_KEEP_ALIVE)
3434

@@ -48,10 +48,9 @@ def try_typeerror(client, exception):
4848
for attr in self.attributes_names:
4949
self.assertRaises(exception, lambda: getattr(client, attr)())
5050

51-
try_attr(without_hide)
5251
try_attr(without_hide_false)
5352

54-
try_typeerror(without_hide, TypeError)
53+
try_typeerror(default_hide, ProtocolError)
5554
try_typeerror(without_hide_false, TypeError)
5655
try_typeerror(with_hide, ProtocolError)
5756

@@ -121,9 +120,9 @@ def test_configparser(self):
121120

122121
client = fastrpc.ServerProxy(config_parser, section)
123122

124-
self.assertEqual(getattr(client, "host"), self.host)
125-
self.assertEqual(getattr(client, "port"), self.port)
126-
self.assertEqual(getattr(client, "url"), self.url)
123+
self.assertEqual(client("get_host"), self.host)
124+
self.assertEqual(client("get_port"), self.port)
125+
self.assertEqual(client("get_url"), self.url)
127126

128127

129128
if __name__ == '__main__':

0 commit comments

Comments
 (0)