Monthly Archives: June 2018

crond和crontab详解

一、crontab是什么? 1. 定时任务软件种类 at... Read More | Share it now!

Creating and using a Redis Cluster

All: https://redis.io/topics/cluster-tutorial Install Ruby 2.4: https://wp.huangshiyang.com/how-to-install-ruby-2-4-on-centos-rhel-7-6 Installing Redis The suggested way of installing Redis is compiling it from sources as Redis has no dependencies... Read More | Share it now!

How to Install Ruby 2.4 on CentOS/RHEL 7/6

Ruby 2.4.2 Released, Ruby is a dynamic, object-oriented programming language focused on simplicity and productivity. RVM (Ruby Version Manager) is a tool for installing and managing multiple Ruby versions on single operating systems. This tutorial will... Read More | Share it now!

rpm命令

rpm命令是RPM软件包的管理工具。rpm原本是Red Hat Linux发行版专门用来管理Linux各项套件的程序,由于它遵循GPL规则且功能强大方便,因而广受欢迎。逐渐受到其他发行版的采用。RPM套件管理方式的出现,让Linux易于安装,升级,间接提升了Linux的适用度。 语法 rpm(选项)(参数) 选项 -a:查询所有套件; -b<完成阶段><套件档>+或-t... Read More | Share it now!

Python单元测试unittest

Python中有一个自带的单元测试框架是unittest模块,用它来做单元测试,它里面封装好了一些校验返回的结果方法和一些用例执行前的初始化操作。 在说unittest之前,先说几个概念: TestCase... Read More | Share it now!

Python Mock的入门

Mock是什么 Mock这个词在英语中有模拟的这个意思,因此我们可以猜测出这个库的主要功能是模拟一些东西。准确的说,Mock是Python中一个用于支持单元测试的库,它的主要功能是使用mock对象替代掉指定的Python对象,以达到模拟对象的行为。简单的说,mock库用于如下的场景: 假设你开发的项目叫a,里面包含了一个模块b,模块b中的一个函数c(也就是a.b.c)在工作的时候需要调用发送请求给特定的服务器来得到一个JSON返回值,然后根据这个返回值来做处理。如果要为a.b.c函数写一个单元测试,该如何做? 一个简单的办法是搭建一个测试的服务器,在单元测试的时候,让a.b.c函数和这个测试服务器交互。但是这种做法有两个问题: 测试服务器可能很不好搭建,或者搭建效率很低。 你搭建的测试服务器可能无法返回所有可能的值,或者需要大量的工作才能达到这个目的。 那么如何在没有测试服务器的情况下进行上面这种情况的单元测试呢?Mock模块就是答案。上面已经说过了,mock模块可以替换Python对象。我们假设a.b.c的代码如下: import... Read More | Share it now!

redis-py-cluster 1.3.4

Project description # redis-py-cluster This client provides a client for redis cluster that was added in redis 3.0. This project is a port of `redis-rb-cluster` by antirez, with alot of added functionality. The original source can be found at... Read More | Share it now!

Time access and conversions Python

This module provides various time-related functions. For related functionality, see also the datetime and calendar modules. Although this module is always available, not all functions are available on all platforms. Most of the functions defined in... Read More | Share it now!