Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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']
Esempio n. 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=/'
Esempio n. 6
0
 def test_delete(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.delete('test')
     assert cd['test']['expires'] == -1
Esempio n. 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=/'
Esempio n. 8
0
 def test_delete(self):
     cd = CookieDict()
     cd.add('test', 'something')
     cd.delete('test')
     assert cd['test']['expires'] == -1