def test_update_private_api_cookie_no_cookie(self): set_cookie_header = "key=value" cookie_helper.store_mock_cookie( "akey=avalue; .AspNet.ApplicationCookie=oldvalue") with self.assertRaises(ValueError) as context: update_private_api_cookie(set_cookie_header)
def test_get_private_api_cookie(self): cookie_helper.store_mock_cookie( "akey=avalue; anotherkey=anothervalue\n") result = get_private_api_cookie() self.assertEqual(result, "akey=avalue; anotherkey=anothervalue")
def test_update_private_api_cookie_case4(self): set_cookie_header = ".AspNet.ApplicationCookie=newValue123" cookie_helper.store_mock_cookie( "akey=avalue; .AspNet.ApplicationCookie=oldvalue") update_private_api_cookie(set_cookie_header) result = cookie_helper.get_mock_cookie() self.assertEqual(result, "akey=avalue;.AspNet.ApplicationCookie=newValue123")