Git Product home page Git Product logo

Comments (9)

rvanlaar avatar rvanlaar commented on August 18, 2024

(by ircubic)

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by jvloothuis)
Thanks for reporting this issue with patch. It seems like a valid way to handle your problem.

It would be nice if there was a test to verify this behavior. Would you be willing to take a stab at this?

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by ircubic)
I tried, but was unable to run the tests. mock was complaining about being unable to patch things, think you might have written them for an older version, so I didn't want to rip them up too much. I think you're better suited to writing the actual tests, since you know the code better.

What I did try to write, though, was a test that ran self.recipe.install(), then checked this:

options = develop_install.call_args[0][2]
self.assertEqual(options['setup'], os.path.join(self.parts_dir, 'django'))

where develop_install is a mock of zc.recipe.egg.Develop.install

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by danfairs)
I'm going to take a quick look at this, though I should add that I get the same problem as Daniel Bruce when running the tests with both Mock 0.5.0 and Mock 0.6.0:

(djangorecipe)leafhopper:djangorecipe dan$ bin/test
Test-module import failures:

Module: djangorecipe.tests

Traceback (most recent call last):
File "/Users/dan/.eggs/djangorecipe-0.19.2-py2.6.egg/djangorecipe/tests.py", line 24, in
class TestRecipe(unittest.TestCase):
File "/Users/dan/.eggs/djangorecipe-0.19.2-py2.6.egg/djangorecipe/tests.py", line 110, in TestRecipe
@mock.patch('subprocess', 'Popen')
File "build/bdist.macosx-10.6-universal/egg/mock.py", line 260, in patch
raise TypeError("Need a valid target to patch. You supplied: %r" % (target,))
TypeError: Need a valid target to patch. You supplied: 'subprocess'

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by danfairs)
My bad - the version of mock required is much older, 0.3.1. Sorry for the noise.

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by danfairs)
This patch is the same change to the recipe code, but updates the tests both to test the new behaviour, and to fix up existing tests.

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by ircubic)
Oh wow, great effort, much thanks.

At the time I filed this bug I had no free time at work to actually fix the tests, or I'd have done it myself, I just had to make do with a locally patched copy of the recipe. I've recently picked up Django again, and it's nice to see things are being done to address this. :)

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by reinout)
I'd like a release with this functionality included. Is it planned?

from djangorecipe.

rvanlaar avatar rvanlaar commented on August 18, 2024

(by roland-micite)
This was released in version 0.20.

from djangorecipe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.