From b3205afe2d634527fe2c6d5f83670f2c1e6c49ba Mon Sep 17 00:00:00 2001 From: Cole Crawford <16374762+ColeDCrawford@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:57:59 -0400 Subject: [PATCH] Fix typo, add more tests --- README.md | 3 ++- edtf/parser/parser_classes.py | 2 +- edtf/parser/tests.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b001157..6acb176 100644 --- a/README.md +++ b/README.md @@ -378,7 +378,8 @@ True False >>> parse_edtf("2004?-~06-~04") -PartialUncertainOrApproximate: '2004?-~06-~04'>>> L2_PartialUncertainOrApproximate.is_approximate +PartialUncertainOrApproximate: '2004?-~06-~04' +>>> parse_edtf("2004?-~06-~04").is_approximate True >>> parse_edtf("2004?-~06-~04").is_uncertain True diff --git a/edtf/parser/parser_classes.py b/edtf/parser/parser_classes.py index b2dbadd..ed03355 100644 --- a/edtf/parser/parser_classes.py +++ b/edtf/parser/parser_classes.py @@ -866,7 +866,7 @@ def __init__( all_ua, ] self.is_uncertain = any( - item.is_uncertain for item in uas if hasattr(item, "is_approximate") + item.is_uncertain for item in uas if hasattr(item, "is_uncertain") ) self.is_approximate = any( item.is_approximate for item in uas if hasattr(item, "is_approximate") diff --git a/edtf/parser/tests.py b/edtf/parser/tests.py index e7f2953..c2dd711 100644 --- a/edtf/parser/tests.py +++ b/edtf/parser/tests.py @@ -253,6 +253,7 @@ ("1984~/2004-06", (False, True, False)), ("2004-%06", (False, False, True)), ("2004?-~06-~04", (True, True, False)), + ("2004?-06-04", (True, False, False)), ("2011-~06-~04", (False, True, False)), ("2004-06-~01/2004-06-~20", (False, True, False)), ("156X~", (False, True, False)),