• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jamielennox / requests-mock
97%

Build:
DEFAULT BRANCH: master
Repo Added 15 Jun 2014 01:03AM UTC
Files 7
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 0.1.0
  • 0.2.0
  • 0.3.0
  • 0.4.0
  • master
  • matcher
  • matcher2
  • matcher3

pending completion
44

Pull #4

travis-ci

prmtl
Allow to decorate class with mock

Now it is possible to mock not only a function but also a class:

  class TestClass(object)

    def test_func_a(self, m):
        m.register_uri('GET', 'http://test.com', text='data')
        ...

    def test_func_b(self, m)
        m.register_uri('GET', 'http://test.com', text='data')
        ...

This new behavior mimics behavior of `patch` from `mock` library.
Pull Request #4: [WIP] Allow to decorate class with mock

315 of 325 relevant lines covered (96.92%)

1.94 hits per line

Relevant lines Covered
Build:
Build:
325 RELEVANT LINES 315 COVERED LINES
1.94 HITS PER LINE
Source Files on master
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
44 master Allow to decorate class with mock Now it is possible to mock not only a function but also a class: class TestClass(object) def test_func_a(self, m): m.register_uri('GET', 'http://test.com', text='data') ... def test_f... Pull #4 13 Dec 2014 06:44PM UTC prmtl travis-ci pending completion  
43 master Remove unnecessary import in tests Pull #2 13 Dec 2014 06:43PM UTC prmtl travis-ci pending completion  
42 master Remove unnecessary import in tests Pull #2 13 Dec 2014 05:38PM UTC prmtl travis-ci pending completion  
41 master Make a public create_response function We need a way for custom matchers to be able to return fully formed responses. Make a new function for this and convert the existing response matchers to use it. push 30 Jul 2014 05:32AM UTC jamielennox travis-ci pending completion  
40 master Change query string tests There is a difference between how urlparse handles if it is a protocol it recognises vs a general URI. This only seems to exist on pypy and py2.6. This is not something that should be managed by us. Let it be handled by... push 30 Jul 2014 01:48AM UTC jamielennox travis-ci pending completion  
39 master Add wrapper around Request object The request object gets picked up in the history. It would be useful to have a wrapper around it so that we can add some test helpers to the last_request etc. push 30 Jul 2014 01:10AM UTC jamielennox travis-ci pending completion  
38 matcher3 Create a public match decorator Isolate the URL matching logic and provide a public match decorator. This should allow for custom matchers to use the same logic and parameters as the register_uri function. push 29 Jul 2014 10:20PM UTC jamielennox travis-ci pending completion  
37 master Add a mock() function This is the same as the Mocker() however it looks more correct to do @requests_mock.mock() rather than @requests_mock.Mocker(). Ideally mock() would be the decorator and Mocker() the context manager but it doesn't really ma... push 29 Jul 2014 08:49PM UTC jamielennox travis-ci pending completion  
36 master Export symbols for HTTP methods This shouldn't be considered the way to use these methods, using the strings are fine, but in certain places people don't like using strings everywhere and so we should have the constants available for them. push 29 Jul 2014 08:36PM UTC jamielennox travis-ci pending completion  
35 matcher2 Make matcher public Not ready yet, needs some tests of the decorator function and needs some more thought as to how to what exactly to be public. push 29 Jul 2014 11:59AM UTC jamielennox travis-ci pending completion  
See All Builds (41)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc