class_docstr: Tests for the Morsel object.
class_docstr_tok: ["Tests","for","the","Morsel","object","."]
code: def test_repr(self):
      morsel = cookies.Morsel()
      self.assertEqual(repr(morsel), "<Morsel: None=None>")
      self.assertEqual(str(morsel), "Set-Cookie: None=None")
      morsel.set("key", "val", "coded_val")
      self.assertEqual(repr(morsel), "<Morsel: key=coded_val>")
      self.assertEqual(str(morsel), "Set-Cookie: key=coded_val")
      morsel.update(
          {
              "path": "/",
              "comment": "foo",
              "domain": "example.com",
              "max-age": 0,
              "secure": 0,
              "version": 1,
          }
      )
      self.assertEqual(
          repr(morsel),
          "<Morsel: key=coded_val; Comment=foo; Domain=example.com; "
          "Max-Age=0; Path=/; Version=1>",
      )
      self.assertEqual(
          str(morsel),
          "Set-Cookie: key=coded_val; Comment=foo; Domain=example.com; "
          "Max-Age=0; Path=/; Version=1",
      )
      morsel["secure"] = True
      morsel["httponly"] = 1
      self.assertEqual(
          repr(morsel),
          "<Morsel: key=coded_val; Comment=foo; Domain=example.com; "
          "HttpOnly; Max-Age=0; Path=/; Secure; Version=1>",
      )
      self.assertEqual(
          str(morsel),
          "Set-Cookie: key=coded_val; Comment=foo; Domain=example.com; "
          "HttpOnly; Max-Age=0; Path=/; Secure; Version=1",
      )
  
      morsel = cookies.Morsel()
      morsel.set("key", "val", "coded_val")
      morsel["expires"] = 0
      self.assertRegex(
          repr(morsel),
          r"<Morsel: key=coded_val; "
          r"expires=\w+, \d+ \w+ \d+ \d+:\d+:\d+ \w+>",
      )
      self.assertRegex(
          str(morsel),
          r"Set-Cookie: key=coded_val; "
          r"expires=\w+, \d+ \w+ \d+ \d+:\d+:\d+ \w+",
      )
  
imports: import copy
  import unittest
  import doctest
  from http import cookies
  import pickle
label_desc: Use image node_id 11 for calling the MorselTests obj's underlying member method code with example usage: obj.test_repr() without return types