Giter Site home page Giter Site logo

Add tests for the code about pyjudge HOT 14 CLOSED

pyjaipur avatar pyjaipur commented on July 17, 2024
Add tests for the code

from pyjudge.

Comments (14)

theSage21 avatar theSage21 commented on July 17, 2024

Some auto testing providers I know of:

The project needs to be integrated with them.

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

@kirtibajaj I guess as you are managing this product, so it should be done by you.

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

do we still need it?
i can work on it.

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

ok then, I am on it. do I need to keep something in mind for the approach ? as i don't have any experience with travis or circle, just little bit of unit tests.

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

For now I think simply testing if the server runs is enough. Later on as need increases we can improve testing standards.

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

that will catch all syntax errors and so on.

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

while writing the tests i faced a error, i tried google too but didn't understand it. else it test for other two functions in server.py are running OK.

def test_file_upload(self):
        #assert app.post('/check/1').status_code == 200
        print(app.post('/check/1').status_code)

and this give me this error.

ERROR: test_file_upload (test_pyjudge.TestPyJudge)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/shivank98/Desktop/PyJudge/PyJudge/test_pyjudge.py", line 16, in test_file_upload
    print(app.post('/check/1').status_code)
  File "/home/shivank98/anaconda3/lib/python3.7/site-packages/webtest/app.py", line 382, in post
    content_type=content_type)
  File "/home/shivank98/anaconda3/lib/python3.7/site-packages/webtest/app.py", line 758, in _gen_request
    expect_errors=expect_errors)
  File "/home/shivank98/anaconda3/lib/python3.7/site-packages/webtest/app.py", line 654, in do_request
    self._check_status(status, res)
  File "/home/shivank98/anaconda3/lib/python3.7/site-packages/webtest/app.py", line 686, in _check_status
    res)
webtest.app.AppError: Bad response: 500 Internal Server Error (not 200 OK or 3xx redirect for http://localhost/check/1)

    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html>
        <head>
            <title>Error: 500 Internal Server Error</title>
            <style type="text/css">
              html {background-color: #eee; font-family: sans;}
              body {background-color: #fff; border: 1px solid #ddd;
                    padding: 15px; margin: 15px;}
              pre {background-color: #eee; border: 1px solid #ddd; padding: 5px;}
            </style>
        </head>
        <body>
            <h1>Error: 500 Internal Server Error</h1>
            <p>Sorry, the requested URL <tt>&#039;http://localhost:80/check/1&#039;</tt>
               caused an error:</p>
            <pre>Internal Server Error</pre>
        </body>
    </html>

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

can we please stop having code in comments. Just submit a PR and we can discuss things there.

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

sure sure, my bad

from pyjudge.

shivankgtm avatar shivankgtm commented on July 17, 2024

@theSage21 i am back. is this issue still on ?
or if i can remember you added tests yourself?

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

This is still on. I haven't written any code I can remember for this

from pyjudge.

cquark7 avatar cquark7 commented on July 17, 2024

Hey @theSage21, I think it would be better to use pytest as our testing framework. What do you think?

from pyjudge.

theSage21 avatar theSage21 commented on July 17, 2024

#68 is already doing that I think

from pyjudge.

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.