test_changed.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:DeepSea 作者: SUSE 项目源码 文件源码
def test_write_checksum(self, log_mock, cfg):
        fs.CreateFile("{}/{}".format(checksum_dir, 'rgw.conf'), contents="foo=bar") 
        cfg = cfg('rgw')
        m = mock_open()
        with patch('__builtin__.open', m, create=True):
            ret = cfg.write_checksum('0b0b0b0b0b0b0b0b0b0b0')
            log_mock.debug.assert_called()
            m.assert_called_once_with('/srv/salt/ceph/configuration/files/ceph.conf.checksum/rgw.conf', 'w')
            m().write.assert_called_once_with('0b0b0b0b0b0b0b0b0b0b0')
            fs.RemoveFile('/srv/salt/ceph/configuration/files/ceph.conf.checksum/rgw.conf')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号