コード例 #1
0
ファイル: test_statics.py プロジェクト: 984958198/tg2
    def test_if_modified_since_future(self):
        next_year = datetime.utcnow()
        next_year.replace(year=next_year.year+1)

        r = self.app.get('/empty_file.unknown',
                         headers={'If-Modified-Since':FileServeApp.make_date(next_year)},
                         status=304)
コード例 #2
0
ファイル: test_statics.py プロジェクト: WildC/SmartMailbox
    def test_if_modified_since_future(self):
        next_year = datetime.utcnow()
        next_year.replace(year=next_year.year + 1)

        r = self.app.get(
            '/empty_file.unknown',
            headers={'If-Modified-Since': FileServeApp.make_date(next_year)},
            status=304)
コード例 #3
0
ファイル: test_statics.py プロジェクト: 984958198/tg2
 def test_make_date(self):
     res = FileServeApp.make_date(datetime(2000, 1, 1, 0, 0, 0, 0))
     assert res == 'Sat, 01 Jan 2000 00:00:00 GMT'
コード例 #4
0
ファイル: test_statics.py プロジェクト: WildC/SmartMailbox
 def test_make_date(self):
     res = FileServeApp.make_date(datetime(2000, 1, 1, 0, 0, 0, 0))
     assert res == 'Sat, 01 Jan 2000 00:00:00 GMT'