示例#1
0
 def test_expire(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.add('blah', 'test')
     cd.expire()
     assert cd['test']['expires'] == -1
     assert cd['blah']['expires'] == -1
示例#2
0
 def test_expire(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.add('blah', 'test')
     cd.expire()
     assert cd['test']['expires'] == -1
     assert cd['blah']['expires'] == -1
示例#3
0
 def test_add(self):
     cd = CookieDict()
     cd.add(name='test', value='something', expires=60, path='/home', domain='test.com', secure=True, httponly=True, comment='Blah')
     cookie = cd['test']
     assert cookie.value == 'something'
     assert cookie['expires'] == 60
     assert cookie['path'] == '/home'
     assert cookie['domain'] == 'test.com'
     assert cookie['secure'] == True
     assert cookie['httponly'] == True
示例#4
0
 def test_add(self):
     cd = CookieDict()
     cd.add(name='test',
            value='something',
            expires=60,
            path='/home',
            domain='test.com',
            secure=True,
            httponly=True,
            comment='Blah')
     cookie = cd['test']
     assert cookie.value == 'something'
     assert cookie['expires'] == 60
     assert cookie['path'] == '/home'
     assert cookie['domain'] == 'test.com'
     assert cookie['secure']
     assert cookie['httponly']
示例#5
0
 def test_output(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.add('blah', 'test')
     assert str(cd) == 'blah=test; Path=/\r\ntest=something; Path=/'
示例#6
0
 def test_delete(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.delete('test')
     assert cd['test']['expires'] == -1
示例#7
0
 def test_output(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.add('blah', 'test')
     assert str(cd) == 'blah=test; Path=/\r\ntest=something; Path=/'
示例#8
0
 def test_delete(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.delete('test')
     assert cd['test']['expires'] == -1