Roundup Tracker - Issues

Issue 2550956

classification
Title: test case of serve_static_files
Type: Severity: normal
Components: Versions:
process
Status: new Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: antmail, rouilj
Priority: Keywords:

Created on 2017-10-25 14:05 by antmail, last changed 2017-10-26 00:50 by rouilj.

Messages
msg6043 Author: [hidden] (antmail) Date: 2017-10-25 14:05
Hello,

I  have  a  question about test case failure. Why do test expect relative
path but not absolute?

test.test_cgi.FormTestCase testMethod=testserve_static_files>

    def testserve_static_files(self):
     ...

        # TEMPLATES dir is searched by default. So this file exists.
        # Check the returned values.
        cl.serve_static_file("issue.index.html")
        self.assertEquals(output[0][1], "text/html")
>       self.assertEquals(output[0][3], "_test_cgi_form/html/issue.index.html")
E       AssertionError: '/devel/hibcore/src/test/_test_cgi_form/html/issue.index.html' !=
'_test_cgi_form/html/issue.index.html'

test_cgi.py:1411: AssertionError
_______________________ memorydbDBTest.testQuietJournal ________________________
msg6044 Author: [hidden] (rouilj) Date: 2017-10-26 00:50
Hi Anthony:

In message <489608269.20171025170504@inbox.ru>,
Anthony writes:

>I  have  a  question about test case failure. Why do test expect relative
>path but not absolute?
>
>test.test_cgi.FormTestCase testMethod=testserve_static_files>
>
>    def testserve_static_files(self):
>     ...
>
>        # TEMPLATES dir is searched by default. So this file exists.
>        # Check the returned values.
>        cl.serve_static_file("issue.index.html")
>        self.assertEquals(output[0][1], "text/html")
>>       self.assertEquals(output[0][3], "_test_cgi_form/html/issue.index.html")
>E       AssertionError: '/devel/hibcore/src/test/_test_cgi_form/html/issue.index.html' !=
>'_test_cgi_form/html/issue.index.html'
>
>test_cgi.py:1411: AssertionError

How did you generate this error? Running:

  ./run_tests.py -k testserve_static_files test/test_cgi.py

  $PWD/run_tests.py -k testserve_static_files test/test_cgi.py

  $PWD/roundup/run_tests.py -k testserve_static_files roundup/test/test_cgi.py

and

  ./run_tests.py -k testserve_static_files $PWD/test/test_cgi.py

all work as expected for me. They generate paths relative to the
current working directory where the test directory is generated.

I expect the relative paths to be repeatable while an absolute path
would not repeatable (it would depend on the absolute location of the
directory where the test was run).
History
Date User Action Args
2017-10-26 00:50:45rouiljsetnosy: + rouilj
messages: + msg6044
2017-10-25 14:05:08antmailcreate