Skip to content

guzzlerio/pyderide

Repository files navigation

#pyderide

Build Status

Python implementation of Deride

The following list is taken from the Deride node.js homepage. Some of the methods are marked with N/A as they are not applicable for python due to language differences.

Information

Contributing

Ensure you run make before pushing (comitting really) and also before submitting a pull request.

The Makefile will ensure that:

  • requirements are installed
  • the tests pass
  • the code is linted

CI

The following python versions are in scope for this package:

  • "2.7"
  • "3.3"
  • "3.4"
  • "3.5"
  • "3.5-dev" # 3.5 development branch
  • "nightly" # currently points to 3.6-dev

Currently excluding:

  • "2.6" won't work with the cachetools package
  • "3.2" won't work with the coverage package

Project

API methods

  • wrap (in progress...)
  • stub
  • func

Expect methods

  • obj.expect.method.called.times(n)
  • obj.expect.method.called.once()
  • obj.expect.method.called.twice()
  • obj.expect.method.called.lt()
  • obj.expect.method.called.lte()
  • obj.expect.method.called.gt()
  • obj.expect.method.called.gte()
  • obj.expect.method.called.never()
  • obj.expect.method.called.withArg(arg) (renamed to with_arg)
  • obj.expect.method.called.withArgs(args) (renamed to with_args)
  • obj.expect.method.called.withMatch(pattern)
  • obj.expect.method.called.matchExactly(args) (renamed to with_args_strict)
  • obj.expect.method.invocation(n)

Reset methods

  • obj.expect.method.called.reset()
  • obj.called.reset() (renamed to obj.expect.reset())

Setup methods

  • obj.setup.method.toDoThis(func) (renamed to to_do_this)
  • obj.setup.method.toReturn(value) (renamed to to_return)
  • obj.setup.method.toResolveWith(value) N/A
  • obj.setup.method.toRejectWith(value) N/A
  • obj.setup.method.toThrow(message) (renamed to to_raise)
  • obj.setup.method.toEmit(event, args) N/A
  • obj.setup.method.toCallbackWith(args) N/A
  • obj.setup.method.toTimeWarp(milliseconds) N/A
  • obj.setup.method.toIntercept(func) (renamed to to_intercept_with)
  • obj.setup.method.when(args|function)
    • .toDoThis
    • .toReturn
    • .toRejectWith N/A
    • .toResolveWith N/A
    • .toThrow (renamed to to_raise)
    • .toEmit N/A
    • .toCallbackWith N/A
    • .toTimeWarp N/A
    • .toIntercept(func) (renamed to to_intercept_with)

About

Mocking library based on composition - in python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published