def test_oblivious_cookie(self): c = Cookie('') # the following method calls are not expected to perfom any function c.open() c['key'] = 1 c.commit() c.close() self.assertEqual(c['key'], 1)
def test_oblivious_cookie(self): c = Cookie('') # the following method calls are not expected to perfom any function c.open() c['key'] = 1 c.commit() c.close() self.assertEqual(c['key'], 1)
def test_multiple_commit(self): c = Cookie(self.tf.name) c.open() c['key'] = 1 c.commit() with open(self.tf.name) as f: self.assertIn('"key": 1', f.read()) c['key'] = 2 c.commit() with open(self.tf.name) as f: self.assertIn('"key": 2', f.read()) c.close()
def test_multiple_commit(self): c = Cookie(self.tf.name) c.open() c['key'] = 1 c.commit() with open(self.tf.name) as f: self.assertIn('"key": 1', f.read()) c['key'] = 2 c.commit() with open(self.tf.name) as f: self.assertIn('"key": 2', f.read()) c.close()