コード例 #1
0
 def _request(**mandatory_parameters) -> Request:
     return Request(**mandatory_parameters)
コード例 #2
0
 def test_optional_should_not_be_present_when_none(self):
     request = Request(mandatory='value')
     request['optional'] = None
     self.assertEqual('value', request['mandatory'])
     self.assertTrue('optional' not in request)
コード例 #3
0
 def test_mandatory_should_be_present_even_when_none(self):
     request = Request(mandatory=None)
     self.assertTrue('mandatory' in request)
     self.assertIsNone(request['mandatory'])
コード例 #4
0
 def test_optional_should_not_be_present_when_none(self):
     request = Request(mandatory="value")
     request["optional"] = None
     self.assertEqual("value", request["mandatory"])
     self.assertTrue("optional" not in request)