]> git-server-git.apps.pok.os.sepia.ceph.com Git - radosgw-agent.git/commitdiff
tests for the new keys to attrs helper
authorAlfredo Deza <adeza@redhat.com>
Tue, 17 Mar 2015 17:38:09 +0000 (13:38 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 17 Mar 2015 17:38:09 +0000 (13:38 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
radosgw_agent/tests/util/test_obj.py

index 3d07431f279cdba6fa964b0c9a8e5cb18ab36eda..f25c8aa98c9c18096827b5830dc86c70f1241783 100644 (file)
@@ -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