librelist archives

« back to archive

Unable to follow Flask Testing tutorial

Unable to follow Flask Testing tutorial

From:
kracekumar ramaraju
Date:
2011-10-25 @ 03:35
Hello

 I have created a Flask app, in the following format

gummi\
            dev\ ->Virtual Env
            runserver.py
            gummi\
                        __init__.py
                        views.py
                        static/
                        templates/
                        test.py

Here is my code https://github.com/kracekumar/Gummi - It is not complete

Now I followed my http://packages.python.org/Flask-Testing/ and my test code
in test.py and when I run test.py

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import views
  File "/home/kracekumar/codes/python/flask/sandbox/gummi/gummi/views.py",
line 2, in <module>
    from gummi import app
ImportError: No module named gummi

I know I am doing something wrong, but I want to have test code in different
file from views.py. Is this right way to do testing ?


-- 
*
"Talk is cheap, show me the code" - Linus Torvalds
Winning Regards
KraceKumar.R
http://kracekumar.wordpress.com
+91-97906-58304
*
*+91-85530-29521*
*
*

Re: [flask] Unable to follow Flask Testing tutorial

From:
Adam Patterson
Date:
2011-10-25 @ 03:54
Put your test.py at the same level as your runserver.py

On Tue, Oct 25, 2011 at 10:35 AM, kracekumar ramaraju
<kracethekingmaker@gmail.com> wrote:
> Hello
>  I have created a Flask app, in the following format
> gummi\
>             dev\ ->Virtual Env
>             runserver.py
>             gummi\
>                         __init__.py
>                         views.py
>                         static/
>                         templates/
>                         test.py
> Here is my code https://github.com/kracekumar/Gummi - It is not complete
> Now I followed my http://packages.python.org/Flask-Testing/ and my test code
> in test.py and when I run test.py
> Traceback (most recent call last):
>   File "test.py", line 3, in <module>
>     import views
>   File "/home/kracekumar/codes/python/flask/sandbox/gummi/gummi/views.py",
> line 2, in <module>
>     from gummi import app
> ImportError: No module named gummi
> I know I am doing something wrong, but I want to have test code in different
> file from views.py. Is this right way to do testing ?
>
> --
> "Talk is cheap, show me the code" - Linus Torvalds
> Winning Regards
> KraceKumar.R
> http://kracekumar.wordpress.com
> +91-97906-58304
> +91-85530-29521
>
>