Thanks Siddharth.
On Mon, May 12, 2014 at 10:22 PM, Siddharth Wagle <[email protected]>wrote: > Hi Subin, > > We have bundled the mock package in the ambari source. > > Path: ambari/ambari-common/src/test/python. > > You might need to uninstall the pypi mock, I am not sure, but adding the > above to your PYTHONPATH should suffice, here is my python path, > > PYTHONPATH= > > /Users/swagle/Documents/workspace/ambari/ambari-server/src/main/python:/Users/swagle/Documents/workspace/ambari/ambari-common/src/test/python > > -Sid > > > > On Mon, May 12, 2014 at 8:44 AM, subin <[email protected]> wrote: > > > Hi All > > > > This maybe a VERY silly question So advanced apologies. > > But I am very confused with why I write this below > > > > > from mock.mock import patch > > > > > instead of > > > > > from mock import patch > > > > > in all testcases of ambari-agent. > > > > I downloaded mock module from https://pypi.python.org/pypi/mock > > and installed it via python setup.py install. > > And then when I check for the module with below commands I find that > > > > > from mock.mock import patch > > > > FAILS !! > > > > > > # pydoc modules |grep mock > > > VBoxREM difflib mock sunaudio > > > # > > > > > > > # python > > > Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) > > > [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>> import mock > > > >>> > > > > > > > > > # python > > > Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32) > > > [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 > > > Type "help", "copyright", "credits" or "license" for more information. > > > >>> import mock.mock > > > Traceback (most recent call last): > > > File "<stdin>", line 1, in <module> > > > ImportError: No module named mock > > > >>> > > > > > > > > > When I look at the testcase in ambari-agent All testcases have > > > > > from mock.mock import patch > > > > > > > > did I install mock module incorrectly or has everyone else installed it > > incorrectly. > > What am I doing wrong AND do mock or mock.mock ? > > > > -- > > ~Subin > > > > -- > CONFIDENTIALITY NOTICE > NOTICE: This message is intended for the use of the individual or entity to > which it is addressed and may contain information that is confidential, > privileged and exempt from disclosure under applicable law. If the reader > of this message is not the intended recipient, you are hereby notified that > any printing, copying, dissemination, distribution, disclosure or > forwarding of this communication is strictly prohibited. If you have > received this communication in error, please contact the sender immediately > and delete it from your system. Thank You. > -- ~Subin
