From 6ce2b4f9a8bcc4a26a066391fe52c6708da819a1 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Tue, 17 Mar 2015 13:38:09 -0400 Subject: [PATCH] tests for the new keys to attrs helper Signed-off-by: Alfredo Deza --- radosgw_agent/tests/util/test_obj.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/radosgw_agent/tests/util/test_obj.py b/radosgw_agent/tests/util/test_obj.py index 3d07431..f25c8aa 100644 --- a/radosgw_agent/tests/util/test_obj.py +++ b/radosgw_agent/tests/util/test_obj.py @@ -30,3 +30,11 @@ class TestToDict(object): result = obj.to_dict(Empty(), a=1, b=2) assert result['a'] == 1 assert result['b'] == 2 + + +class TestKeysToAttribute(object): + + def test_replace_dashes(self): + dictionary = {'dashed-word': 1} + result = obj.keys_to_attributes(dictionary) + assert result.dashed_word == 1 -- 2.47.3