def aValidID(simpleIdValue): return ID(aValidUUID(simpleIdValue))
def test_is_unique(self): assert_that(ID.invalid(), is_not(equal_to(ID.invalid())))
def test_creates_an_id_based_on_a_uuid(self): assert_that(ID.from_string(str(aValidUUID('34'))), equal_to(ID(aValidUUID('34'))))
def test_is_invalid_id_when_invalid(self): assert_that(str(ID.invalid()), starts_with('invalid_id'))
def test_is_the_string_value_of_the_uuid(self): assert_that(str(ID(aValidUUID('34'))), equal_to(str(aValidUUID('34'))))
def test_it_is_hashable_when_invalid(self): invalid_id = ID.invalid() assert_that({invalid_id: 'some_value'}[invalid_id], equal_to('some_value'))
def test_creates_an_invalid_id_when_the_string_value_is_not_a_valid_uuid( self): assert_that(ID.from_string('34').valid, is_(equal_to(False)))
def test_is_valid(self): assert_that( ID.from_string(str(aValidUUID('34'))).valid, is_(equal_to(True)))