def check_marshalled_restart_policy(test_case, policy_type, **attributes):
 expected_name = FLOCKER_RESTART_POLICY_POLICY_TO_NAME[policy_type]
 test_case.assertEqual(dict(name=expected_name, **attributes), marshalled_restart_policy(policy_type(**attributes)))

def check_marshalled_restart_policy ( test_case , policy_type , ** attributes ) : expected_name = FLOCKER_RESTART_POLICY_POLICY_TO_NAME [ policy_type ] test_case . assertEqual ( dict ( name = expected_name , ** attributes ) , marshalled_restart_policy ( policy_type ( ** attributes ) ) )
assert that the supplied policy_type can be marshalled to a dict and that the dict contains all the supplied policy attributes .