Roundup Tracker - Issues


Author antmail
Recipients antmail, ber, rouilj
Date 2018-02-12.15:51:23
Message-id <>
In-reply-to <20171026005031.760724C0799@itserver6.localdomain>

Sorry for the late reply. I suspended the subject because of thinking
that I'm doing something wrong again.

I run test as:
 ./ -k testserve_static_files test/
 and get error:
 AssertionError: '/devel/hibcore/src/_test_cgi_form/html/issue.index.html' != '_test_cgi_form/html/issue.index.html'

 I have slightly different code base so this may be not an issue.
 I  note  the subject  because I guess this is related to parts that I didn't
 touch.  I did look in code and wondering how relative path can be expected here.

 The  serve_static_file  has the following assignments:

 filename = os.path.normpath(os.path.join(p, file))

where p is  self.instance.config['TEMPLATES'] or self.instance.config['STATIC_FILES']

'TEMPLATES'       and      'STATIC_FILES'      are      FilePathOption
(MultiFilePathOption)  object.   Both  options return an absolute path
like this:

 if _val and not os.path.isabs(_val):
   _val = os.path.join(self.config["HOME"], _val)

So I don't understand how 'filename' can be a relative path.

But may be I've touched some code and forget.

> John Rouillard added the comment:

> Hi Anthony:

> In message <>,
> 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' !=
>> AssertionError

> How did you generate this error? Running:

>   ./ -k testserve_static_files test/

>   $PWD/ -k testserve_static_files test/

>   $PWD/roundup/ -k testserve_static_files roundup/test/

> and

>   ./ -k testserve_static_files $PWD/test/

> 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).

> ----------
> nosy: +rouilj

> ________________________________________________
> Roundup tracker <>
> <>
> ________________________________________________
Date User Action Args
2018-02-12 15:51:24antmailsetrecipients: + antmail, ber, rouilj
2018-02-12 15:51:24antmaillinkissue2550956 messages
2018-02-12 15:51:23antmailcreate