def test_validate_item_values_value_is_non_int(): payload = { 'external_id': 'abc', 'value': 'five' } with pytest.raises(falcon.HTTPBadRequest): validate_item_values(payload)
def test_validate_item_values_name_is_non_ascii(): payload = { 'external_id': 'abc', 'name': u'śćżźół' } with pytest.raises(falcon.HTTPBadRequest): validate_item_values(payload)
def test_validate_item_values_value_is_int_conv_from_float(): payload = { 'external_id': 'abc', 'value': 5.00000001 } result = validate_item_values(payload) assert type(result) == dict
def test_validate_item_values_value_is_int(): payload = { 'external_id': 'abc', 'value': 5 } result = validate_item_values(payload) assert type(result) == dict
def test_validate_item_values_name_is_ascii(): payload = { 'external_id': 'abc', 'name': 'some_name' } result = validate_item_values(payload) assert type(result) == dict
def test_validate_item_values_no_ext_id(): payload = { 'value': 7 } with pytest.raises(falcon.HTTPBadRequest): validate_item_values(payload)