Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #107 from jacebrowning/hotfix/v0.6.1
Browse files Browse the repository at this point in the history
Hotfix v0.6.1
  • Loading branch information
jacebrowning committed Feb 23, 2016
2 parents 7630fb2 + 172c21c commit e9e92da
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision History

## 0.6.1 (2015/02/23)

- Fixed handling of `None` in `NullableString`.

## 0.6 (2015/02/23)

- Added preliminary support for JSON serialization (@pr0xmeh).
Expand Down
2 changes: 1 addition & 1 deletion yorm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys

__project__ = 'YORM'
__version__ = '0.6'
__version__ = '0.6.1'

VERSION = __project__ + '-' + __version__

Expand Down
5 changes: 5 additions & 0 deletions yorm/test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
import expecter


def is_none(x):
return x is None


def is_true(x):
return x is True

Expand All @@ -23,6 +27,7 @@ def missing(x):
return not os.path.exists(x)


expecter.add_expectation(is_none)
expecter.add_expectation(is_true)
expecter.add_expectation(is_false)
expecter.add_expectation(exists)
Expand Down
22 changes: 19 additions & 3 deletions yorm/test/test_types_extended.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# pylint: disable=missing-docstring,no-self-use,misplaced-comparison-constant
# pylint: disable=missing-docstring,unused-variable,misplaced-comparison-constant,no-self-use

import pytest
from expecter import expect

from yorm.utilities import attr
from yorm.types import Integer, String, Float
from yorm.types.extended import Markdown, AttributeDictionary, SortedList
from yorm.types.standard import Integer, String, Float
from yorm.types.extended import (NullableString, Markdown,
AttributeDictionary, SortedList)


# CLASSES ######################################################################
Expand Down Expand Up @@ -37,6 +39,20 @@ class UnknownSortedList(SortedList):
# TESTS ########################################################################


def describe_nullable_string():

def describe_to_value():

def it_allows_none():
expect(NullableString.to_value(None)).is_none()

def describe_to_data():

def it_allows_none():
expect(NullableString.to_data(None)).is_none()


# TODO: make these tests look like `test_types_standard.py`
class TestMarkdown:

"""Unit tests for the `Markdown` converter."""
Expand Down
2 changes: 1 addition & 1 deletion yorm/types/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _optimize_for_quoting(value):
for num in (int, float):
try:
return num(value)
except ValueError:
except (TypeError, ValueError):
continue
return value

Expand Down

0 comments on commit e9e92da

Please sign in to comment.