Revision 221820b8

b/kamaki/clients/pithos.py
966 966
           permissions will be removed
967 967
        """
968 968

  
969
        perms = dict(
970
            read='' if not read_permition else read_permition,
971
            write='' if not write_permition else write_permition)
969
        perms = dict(read=read_permition or '', write=write_permition or '')
972 970
        r = self.object_post(obj, update=True, permissions=perms)
973 971
        r.release()
974 972

  
b/kamaki/clients/test/pithos.py
983 983
            r = self.client.get_object_sharing(obj)
984 984
            expected.pop('write')
985 985
            self.assert_dicts_are_equal(r, expected)
986

  
987
    @patch('%s.object_post' % pithos_pkg, return_value=FR())
988
    def test_set_object_sharing(self, POST):
989
        read_perms = ['u1', 'g1', 'u2', 'g2']
990
        write_perms = ['u1', 'g1']
991
        for kwargs in (
992
                dict(read_permition=read_perms, write_permition=write),
993
                dict(read_permition=read_perms),
994
                dict(write_permition=write_perms)).items():
995
            self.client.set_object_sharing(obj, **kwargs)
996
            if 'read_permition' in kwargs:
997
                kwargs['read'] = kwargs.pop('read_permition')
998
            if 'write_permition' in kwargs:
999
                kwargs['write'] = kwargs.pop('write_permition')
1000
            self.assertEqual(
1001
                POST.mock_calls[-1],
1002
                call(obj, update=True, permissions=kwargs)
1003

  

Also available in: Unified diff