def test_make_required(self): output_dict = adapt_dict( self.input_dict, make_required=['to_make_required']) def the_assert(output_dict): for key in output_dict: if str(key) == 'to_make_required' and isinstance(key, Required): return True return False self.assertTrue(the_assert(output_dict))
def test_remove(self): output_dict = adapt_dict(self.input_dict, remove=['to_remove']) self.assertEqual(output_dict, {'to_keep': 'dummy', 'to_make_required': 'dummy'})
def test_keep(self): output_dict = adapt_dict(self.input_dict, keep=['to_keep']) self.assertEqual(output_dict, {'to_keep': 'dummy'})