Skip to content

Commit

Permalink
Merge pull request #68 from ixc/62_verify_related_fields
Browse files Browse the repository at this point in the history
62 verify related fields
  • Loading branch information
aweakley authored Jul 7, 2024
2 parents ec5dcc4 + 1a5ebd5 commit ca7e02e
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
44 changes: 44 additions & 0 deletions edtf/fields.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import pickle

from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
from django.db.models import signals
Expand Down Expand Up @@ -188,3 +189,46 @@ def contribute_to_class(self, cls, name, **kwargs):
# Only run post-initialization values update on non-abstract models
if not cls._meta.abstract:
signals.post_init.connect(self.update_values, sender=cls)

def check(self, **kwargs):
errors = super().check(**kwargs)

for field_alias in [
"direct_input_field",
"lower_fuzzy_field",
"lower_strict_field",
"natural_text_field",
"upper_fuzzy_field",
"upper_strict_field",
]:
errors.extend(self._check_field(field_alias))

return errors

def _check_field(self, field_alias):
field_name = getattr(self, field_alias, None)

# Check if the alias value has been provided in the field definition
if not field_name:
return [
checks.Error(
f"You must specify a '{field_alias}' for EDTFField",
hint=None,
obj=self,
id="python-edtf.EDTF01",
)
]

# Check if the field that is referenced actually exists
try:
self.model._meta.get_field(field_name)
except FieldDoesNotExist:
return [
checks.Error(
f"'{self.name}' refers to a non-existent '{field_alias}' field: '{field_name}'",
hint=None,
obj=self,
id="python-edtf.EDTF02",
)
]
return []
31 changes: 31 additions & 0 deletions edtf_django_tests/edtf_integration/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,34 @@ def test_comparison(self):
self.event2.date_edtf,
"2019-11 is less than 2021-05-06",
)

def test_field_related_field_specification(self):
edtf_field_on_model = TestEvent._meta.get_field("date_edtf")
required_fields = (
"direct_input_field",
"lower_fuzzy_field",
"lower_strict_field",
"natural_text_field",
"upper_fuzzy_field",
"upper_strict_field",
)
for field_alias in required_fields:
# Remove the alias from the edtf_field
orig_value = getattr(edtf_field_on_model, field_alias)
setattr(edtf_field_on_model, field_alias, None)
errors = edtf_field_on_model.check()
self.assertEqual(len(errors), 1)
self.assertTrue(field_alias in errors[0].msg)
# Should be an 'alias not specified' error
self.assertEqual(errors[0].id, "python-edtf.EDTF01")

# Point the alias to a non-existent field
setattr(edtf_field_on_model, field_alias, "fake")
errors = edtf_field_on_model.check()
self.assertEqual(len(errors), 1)
self.assertTrue(field_alias in errors[0].msg)
# Should be a 'non-eixstent field' error
self.assertEqual(errors[0].id, "python-edtf.EDTF02")

# Repair the field so later tests can still work
setattr(edtf_field_on_model, field_alias, orig_value)

5 comments on commit ca7e02e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/edtf
   __init__.py40100% 
   appsettings.py28485%10–13
   convert.py634430%11–19, 21, 38–39, 52, 61, 72–73, 75, 104, 107–109, 113, 117, 136–156
   fields.py1192281%70, 84, 89, 91, 94–95, 97–98, 100, 105, 109–112, 135–136, 157, 167–168, 172–173, 181
   jdutil.py986632%37, 55, 91–92, 105, 152, 154–155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 251–252, 254–255, 257–258, 260, 262, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py71710%3–4, 6, 9–13, 16–21, 24–25, 28–29, 32–37, 40–44, 52–53, 56–62, 65–71, 74–79, 82–85, 88–91, 94–97, 100–107
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/edtf/natlang
   __init__.py20100% 
   en.py1477151%33, 43–44, 46–49, 54–55, 58–61, 63, 67–70, 72–73, 75–77, 85–87, 89–93, 103, 105, 118, 125, 156–158, 160–165, 168–170, 172–177, 201–204, 208, 223, 225–226, 228, 245, 247, 255, 257, 259, 261, 266, 269, 275
   tests.py10100%3, 5, 10, 179, 184–185, 190–191, 207, 211
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/edtf/parser
   __init__.py40100% 
   edtf_exceptions.py151126%13–19, 22–24, 29
   grammar.py1281191%148–151, 350, 355–360
   parser_classes.py63335044%69, 71, 78–81, 83–84, 86–87, 110–112, 116, 119, 122, 181, 183, 190, 192, 198–202, 207–213, 220–224, 229–235, 246, 257, 286, 290, 302–304, 309, 317–319, 322, 337–338, 342, 371–375, 378, 383–384, 387, 390, 393, 396–400, 403–407, 427–429, 453, 457, 462, 464, 483, 490, 506, 515–517, 519–521, 524–525, 527, 530–533, 535, 537–539, 541, 545, 558, 565–568, 571, 574–577, 580–583, 585–589, 592–593, 596, 600, 606–607, 610, 613–614, 617, 621–622, 625–626, 629, 635, 640–641, 647, 649, 652–654, 660, 665–666, 669, 675, 677, 681–695, 700–702, 706, 708, 711–713, 717, 719, 722–724, 730–733, 738–739, 744–745, 747, 750, 753–755, 757, 760, 763–766, 768–774, 781–784, 786–792, 801–802, 805, 808, 811–813, 815, 823, 842–844, 846–849, 851–852, 854–855, 857, 859, 868, 871, 874, 881–882, 884–885, 887, 889, 891–892, 894, 896–901, 903, 905, 907–908, 910, 913–915, 918–920, 923–925, 933, 935–936, 939–940, 943–944, 947–948, 950–951, 955, 959–960, 963, 968–969, 973–974, 976–984, 986, 996–997, 999, 1001–1002, 1004, 1007, 1012, 1017, 1023–1024, 1027, 1030, 1033, 1035–1037, 1039, 1044–1045, 1047, 1056–1057, 1060, 1063, 1066–1067, 1069, 1078–1079, 1081–1083, 1085–1088, 1100–1102, 1107, 1110–1111, 1113, 1118
   tests.py89890%3–4, 6, 8–10, 26, 229, 243, 262, 284, 286–289, 291–293, 295–299, 302–303, 305–306, 309–311, 314–315, 318–321, 324, 327–331, 334, 337, 340, 343–348, 351, 354, 357, 362–363, 365–366, 369–370, 372–374, 377, 379–384, 386–393, 396–398, 400, 403–404, 410–414
edtf
   __init__.py40100% 
   appsettings.py28292%12–13
   convert.py631182%11–19, 21, 73
   fields.py1191190%1, 3–8, 10–13, 15, 23, 29, 31, 33–35, 38–39, 51–58, 60, 63, 65–70, 72–76, 78–79, 81, 83–84, 86, 88–89, 91, 93–95, 97–98, 100, 102–105, 107, 109–112, 114, 123–125, 128, 131–132, 135–136, 139–140, 142–144, 147, 151, 153, 155, 157, 160–173, 179, 181–182, 184–185, 190–191, 193–194, 196, 204, 206, 208–209, 212–213, 223–226, 234
   jdutil.py984455%37, 55, 91–92, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py710100% 
edtf/natlang
   __init__.py20100% 
   en.py1471192%55, 58, 118, 164–165, 176–177, 203–204, 208, 275
   tests.py10190%211
edtf/parser
   __init__.py40100% 
   edtf_exceptions.py15286%24, 29
   grammar.py128298%357, 359
   parser_classes.py6339884%110–112, 119, 122, 183, 189–193, 200–202, 209–213, 222–224, 229–235, 246, 337–338, 371–375, 378, 393, 396–400, 403–407, 427–429, 545, 581, 589, 593, 640–641, 647, 665–666, 669, 675, 682, 684, 688, 695, 760, 766, 770, 784, 788, 882, 900–901, 903, 908, 914, 919, 924, 960, 963, 969, 974, 976–984, 999, 1004, 1081, 1085, 1118
   tests.py89198%400
TOTAL2822104063% 

Tests Skipped Failures Errors Time
279 0 💤 0 ❌ 0 🔥 4.882s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/edtf
   __init__.py40100% 
   appsettings.py28485%10–13
   convert.py634430%11–19, 21, 38–39, 52, 61, 72–73, 75, 104, 107–109, 113, 117, 136–156
   fields.py1192281%70, 84, 89, 91, 94–95, 97–98, 100, 105, 109–112, 135–136, 157, 167–168, 172–173, 181
   jdutil.py986632%37, 55, 91–92, 105, 152, 154–155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 251–252, 254–255, 257–258, 260, 262, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py71710%3–4, 6, 9–13, 16–21, 24–25, 28–29, 32–37, 40–44, 52–53, 56–62, 65–71, 74–79, 82–85, 88–91, 94–97, 100–107
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/edtf/natlang
   __init__.py20100% 
   en.py1477151%33, 43–44, 46–49, 54–55, 58–61, 63, 67–70, 72–73, 75–77, 85–87, 89–93, 103, 105, 118, 125, 156–158, 160–165, 168–170, 172–177, 201–204, 208, 223, 225–226, 228, 245, 247, 255, 257, 259, 261, 266, 269, 275
   tests.py10100%3, 5, 10, 179, 184–185, 190–191, 207, 211
/opt/hostedtoolcache/Python/3.10.14/x64/lib/python3.10/site-packages/edtf/parser
   __init__.py40100% 
   edtf_exceptions.py151126%13–19, 22–24, 29
   grammar.py1281191%148–151, 350, 355–360
   parser_classes.py63335044%69, 71, 78–81, 83–84, 86–87, 110–112, 116, 119, 122, 181, 183, 190, 192, 198–202, 207–213, 220–224, 229–235, 246, 257, 286, 290, 302–304, 309, 317–319, 322, 337–338, 342, 371–375, 378, 383–384, 387, 390, 393, 396–400, 403–407, 427–429, 453, 457, 462, 464, 483, 490, 506, 515–517, 519–521, 524–525, 527, 530–533, 535, 537–539, 541, 545, 558, 565–568, 571, 574–577, 580–583, 585–589, 592–593, 596, 600, 606–607, 610, 613–614, 617, 621–622, 625–626, 629, 635, 640–641, 647, 649, 652–654, 660, 665–666, 669, 675, 677, 681–695, 700–702, 706, 708, 711–713, 717, 719, 722–724, 730–733, 738–739, 744–745, 747, 750, 753–755, 757, 760, 763–766, 768–774, 781–784, 786–792, 801–802, 805, 808, 811–813, 815, 823, 842–844, 846–849, 851–852, 854–855, 857, 859, 868, 871, 874, 881–882, 884–885, 887, 889, 891–892, 894, 896–901, 903, 905, 907–908, 910, 913–915, 918–920, 923–925, 933, 935–936, 939–940, 943–944, 947–948, 950–951, 955, 959–960, 963, 968–969, 973–974, 976–984, 986, 996–997, 999, 1001–1002, 1004, 1007, 1012, 1017, 1023–1024, 1027, 1030, 1033, 1035–1037, 1039, 1044–1045, 1047, 1056–1057, 1060, 1063, 1066–1067, 1069, 1078–1079, 1081–1083, 1085–1088, 1100–1102, 1107, 1110–1111, 1113, 1118
   tests.py89890%3–4, 6, 8–10, 26, 229, 243, 262, 284, 286–289, 291–293, 295–299, 302–303, 305–306, 309–311, 314–315, 318–321, 324, 327–331, 334, 337, 340, 343–348, 351, 354, 357, 362–363, 365–366, 369–370, 372–374, 377, 379–384, 386–393, 396–398, 400, 403–404, 410–414
edtf
   __init__.py40100% 
   appsettings.py28292%12–13
   convert.py631182%11–19, 21, 73
   fields.py1191190%1, 3–8, 10–13, 15, 23, 29, 31, 33–35, 38–39, 51–58, 60, 63, 65–70, 72–76, 78–79, 81, 83–84, 86, 88–89, 91, 93–95, 97–98, 100, 102–105, 107, 109–112, 114, 123–125, 128, 131–132, 135–136, 139–140, 142–144, 147, 151, 153, 155, 157, 160–173, 179, 181–182, 184–185, 190–191, 193–194, 196, 204, 206, 208–209, 212–213, 223–226, 234
   jdutil.py984455%37, 55, 91–92, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py710100% 
edtf/natlang
   __init__.py20100% 
   en.py1471192%55, 58, 118, 164–165, 176–177, 203–204, 208, 275
   tests.py10190%211
edtf/parser
   __init__.py40100% 
   edtf_exceptions.py15286%24, 29
   grammar.py128298%357, 359
   parser_classes.py6339884%110–112, 119, 122, 183, 189–193, 200–202, 209–213, 222–224, 229–235, 246, 337–338, 371–375, 378, 393, 396–400, 403–407, 427–429, 545, 581, 589, 593, 640–641, 647, 665–666, 669, 675, 682, 684, 688, 695, 760, 766, 770, 784, 788, 882, 900–901, 903, 908, 914, 919, 924, 960, 963, 969, 974, 976–984, 999, 1004, 1081, 1085, 1118
   tests.py89198%400
TOTAL2822104063% 

Tests Skipped Failures Errors Time
279 0 💤 0 ❌ 0 🔥 4.238s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/edtf
   __init__.py40100% 
   appsettings.py28485%10–13
   convert.py634430%11–19, 21, 38–39, 52, 61, 72–73, 75, 104, 107–109, 113, 117, 136–156
   fields.py1192281%70, 84, 89, 91, 94–95, 97–98, 100, 105, 109–112, 135–136, 157, 167–168, 172–173, 181
   jdutil.py986632%37, 55, 91–92, 105, 152, 154–155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 251–252, 254–255, 257–258, 260, 262, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py71710%3–4, 6, 9–13, 16–21, 24–25, 28–29, 32–37, 40–44, 52–53, 56–62, 65–71, 74–79, 82–85, 88–91, 94–97, 100–107
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/edtf/natlang
   __init__.py20100% 
   en.py1477151%33, 43–44, 46–49, 54–55, 58–61, 63, 67–70, 72–73, 75–77, 85–87, 89–93, 103, 105, 118, 125, 156–158, 160–165, 168–170, 172–177, 201–204, 208, 223, 225–226, 228, 245, 247, 255, 257, 259, 261, 266, 269, 275
   tests.py10100%3, 5, 10, 179, 184–185, 190–191, 207, 211
/opt/hostedtoolcache/Python/3.9.19/x64/lib/python3.9/site-packages/edtf/parser
   __init__.py40100% 
   edtf_exceptions.py151126%13–19, 22–24, 29
   grammar.py1281191%148–151, 350, 355–360
   parser_classes.py63335044%69, 71, 78–81, 83–84, 86–87, 110–112, 116, 119, 122, 181, 183, 190, 192, 198–202, 207–213, 220–224, 229–235, 246, 257, 286, 290, 302–304, 309, 317–319, 322, 337–338, 342, 371–375, 378, 383–384, 387, 390, 393, 396–400, 403–407, 427–429, 453, 457, 462, 464, 483, 490, 506, 515–517, 519–521, 524–525, 527, 530–533, 535, 537–539, 541, 545, 558, 565–568, 571, 574–577, 580–583, 585–589, 592–593, 596, 600, 606–607, 610, 613–614, 617, 621–622, 625–626, 629, 635, 640–641, 647, 649, 652–654, 660, 665–666, 669, 675, 677, 681–695, 700–702, 706, 708, 711–713, 717, 719, 722–724, 730–733, 738–739, 744–745, 747, 750, 753–755, 757, 760, 763–766, 768–774, 781–784, 786–792, 801–802, 805, 808, 811–813, 815, 823, 842–844, 846–849, 851–852, 854–855, 857, 859, 868, 871, 874, 881–882, 884–885, 887, 889, 891–892, 894, 896–901, 903, 905, 907–908, 910, 913–915, 918–920, 923–925, 933, 935–936, 939–940, 943–944, 947–948, 950–951, 955, 959–960, 963, 968–969, 973–974, 976–984, 986, 996–997, 999, 1001–1002, 1004, 1007, 1012, 1017, 1023–1024, 1027, 1030, 1033, 1035–1037, 1039, 1044–1045, 1047, 1056–1057, 1060, 1063, 1066–1067, 1069, 1078–1079, 1081–1083, 1085–1088, 1100–1102, 1107, 1110–1111, 1113, 1118
   tests.py89890%3–4, 6, 8–10, 26, 229, 243, 262, 284, 286–289, 291–293, 295–299, 302–303, 305–306, 309–311, 314–315, 318–321, 324, 327–331, 334, 337, 340, 343–348, 351, 354, 357, 362–363, 365–366, 369–370, 372–374, 377, 379–384, 386–393, 396–398, 400, 403–404, 410–414
edtf
   __init__.py40100% 
   appsettings.py28292%12–13
   convert.py631182%11–19, 21, 73
   fields.py1191190%1, 3–8, 10–13, 15, 23, 29, 31, 33–35, 38–39, 51–58, 60, 63, 65–70, 72–76, 78–79, 81, 83–84, 86, 88–89, 91, 93–95, 97–98, 100, 102–105, 107, 109–112, 114, 123–125, 128, 131–132, 135–136, 139–140, 142–144, 147, 151, 153, 155, 157, 160–173, 179, 181–182, 184–185, 190–191, 193–194, 196, 204, 206, 208–209, 212–213, 223–226, 234
   jdutil.py984455%37, 55, 91–92, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py710100% 
edtf/natlang
   __init__.py20100% 
   en.py1471192%55, 58, 118, 164–165, 176–177, 203–204, 208, 275
   tests.py10190%211
edtf/parser
   __init__.py40100% 
   edtf_exceptions.py15286%24, 29
   grammar.py128298%357, 359
   parser_classes.py6339884%110–112, 119, 122, 183, 189–193, 200–202, 209–213, 222–224, 229–235, 246, 337–338, 371–375, 378, 393, 396–400, 403–407, 427–429, 545, 581, 589, 593, 640–641, 647, 665–666, 669, 675, 682, 684, 688, 695, 760, 766, 770, 784, 788, 882, 900–901, 903, 908, 914, 919, 924, 960, 963, 969, 974, 976–984, 999, 1004, 1081, 1085, 1118
   tests.py89198%400
TOTAL2822104063% 

Tests Skipped Failures Errors Time
279 0 💤 0 ❌ 0 🔥 4.375s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/edtf
   __init__.py40100% 
   appsettings.py28485%10–13
   convert.py634430%11–19, 21, 38–39, 52, 61, 72–73, 75, 104, 107–109, 113, 117, 136–156
   fields.py1192281%70, 84, 89, 91, 94–95, 97–98, 100, 105, 109–112, 135–136, 157, 167–168, 172–173, 181
   jdutil.py986632%37, 55, 91–92, 105, 152, 154–155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 251–252, 254–255, 257–258, 260, 262, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py71710%3–4, 6, 9–13, 16–21, 24–25, 28–29, 32–37, 40–44, 52–53, 56–62, 65–71, 74–79, 82–85, 88–91, 94–97, 100–107
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/edtf/natlang
   __init__.py20100% 
   en.py1477151%33, 43–44, 46–49, 54–55, 58–61, 63, 67–70, 72–73, 75–77, 85–87, 89–93, 103, 105, 118, 125, 156–158, 160–165, 168–170, 172–177, 201–204, 208, 223, 225–226, 228, 245, 247, 255, 257, 259, 261, 266, 269, 275
   tests.py10100%3, 5, 10, 179, 184–185, 190–191, 207, 211
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/edtf/parser
   __init__.py40100% 
   edtf_exceptions.py151126%13–19, 22–24, 29
   grammar.py1281191%148–151, 350, 355–360
   parser_classes.py63335044%69, 71, 78–81, 83–84, 86–87, 110–112, 116, 119, 122, 181, 183, 190, 192, 198–202, 207–213, 220–224, 229–235, 246, 257, 286, 290, 302–304, 309, 317–319, 322, 337–338, 342, 371–375, 378, 383–384, 387, 390, 393, 396–400, 403–407, 427–429, 453, 457, 462, 464, 483, 490, 506, 515–517, 519–521, 524–525, 527, 530–533, 535, 537–539, 541, 545, 558, 565–568, 571, 574–577, 580–583, 585–589, 592–593, 596, 600, 606–607, 610, 613–614, 617, 621–622, 625–626, 629, 635, 640–641, 647, 649, 652–654, 660, 665–666, 669, 675, 677, 681–695, 700–702, 706, 708, 711–713, 717, 719, 722–724, 730–733, 738–739, 744–745, 747, 750, 753–755, 757, 760, 763–766, 768–774, 781–784, 786–792, 801–802, 805, 808, 811–813, 815, 823, 842–844, 846–849, 851–852, 854–855, 857, 859, 868, 871, 874, 881–882, 884–885, 887, 889, 891–892, 894, 896–901, 903, 905, 907–908, 910, 913–915, 918–920, 923–925, 933, 935–936, 939–940, 943–944, 947–948, 950–951, 955, 959–960, 963, 968–969, 973–974, 976–984, 986, 996–997, 999, 1001–1002, 1004, 1007, 1012, 1017, 1023–1024, 1027, 1030, 1033, 1035–1037, 1039, 1044–1045, 1047, 1056–1057, 1060, 1063, 1066–1067, 1069, 1078–1079, 1081–1083, 1085–1088, 1100–1102, 1107, 1110–1111, 1113, 1118
   tests.py89890%3–4, 6, 8–10, 26, 229, 243, 262, 284, 286–289, 291–293, 295–299, 302–303, 305–306, 309–311, 314–315, 318–321, 324, 327–331, 334, 337, 340, 343–348, 351, 354, 357, 362–363, 365–366, 369–370, 372–374, 377, 379–384, 386–393, 396–398, 400, 403–404, 410–414
edtf
   __init__.py40100% 
   appsettings.py28292%12–13
   convert.py631182%11–19, 21, 73
   fields.py1191190%1, 3–8, 10–13, 15, 23, 29, 31, 33–35, 38–39, 51–58, 60, 63, 65–70, 72–76, 78–79, 81, 83–84, 86, 88–89, 91, 93–95, 97–98, 100, 102–105, 107, 109–112, 114, 123–125, 128, 131–132, 135–136, 139–140, 142–144, 147, 151, 153, 155, 157, 160–173, 179, 181–182, 184–185, 190–191, 193–194, 196, 204, 206, 208–209, 212–213, 223–226, 234
   jdutil.py984455%37, 55, 91–92, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py710100% 
edtf/natlang
   __init__.py20100% 
   en.py1471192%55, 58, 118, 164–165, 176–177, 203–204, 208, 275
   tests.py10190%211
edtf/parser
   __init__.py40100% 
   edtf_exceptions.py15286%24, 29
   grammar.py128298%357, 359
   parser_classes.py6339884%110–112, 119, 122, 183, 189–193, 200–202, 209–213, 222–224, 229–235, 246, 337–338, 371–375, 378, 393, 396–400, 403–407, 427–429, 545, 581, 589, 593, 640–641, 647, 665–666, 669, 675, 682, 684, 688, 695, 760, 766, 770, 784, 788, 882, 900–901, 903, 908, 914, 919, 924, 960, 963, 969, 974, 976–984, 999, 1004, 1081, 1085, 1118
   tests.py89198%400
TOTAL2822104063% 

Tests Skipped Failures Errors Time
279 0 💤 0 ❌ 0 🔥 4.117s ⏱️

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/edtf
   __init__.py40100% 
   appsettings.py28485%10–13
   convert.py634430%11–19, 21, 38–39, 52, 61, 72–73, 75, 104, 107–109, 113, 117, 136–156
   fields.py1192281%70, 84, 89, 91, 94–95, 97–98, 100, 105, 109–112, 135–136, 157, 167–168, 172–173, 181
   jdutil.py986632%37, 55, 91–92, 105, 152, 154–155, 157, 159, 161, 163, 165, 167, 169, 171, 173, 175, 251–252, 254–255, 257–258, 260, 262, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py71710%3–4, 6, 9–13, 16–21, 24–25, 28–29, 32–37, 40–44, 52–53, 56–62, 65–71, 74–79, 82–85, 88–91, 94–97, 100–107
/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/edtf/natlang
   __init__.py20100% 
   en.py1477151%33, 43–44, 46–49, 54–55, 58–61, 63, 67–70, 72–73, 75–77, 85–87, 89–93, 103, 105, 118, 125, 156–158, 160–165, 168–170, 172–177, 201–204, 208, 223, 225–226, 228, 245, 247, 255, 257, 259, 261, 266, 269, 275
   tests.py10100%3, 5, 10, 179, 184–185, 190–191, 207, 211
/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/edtf/parser
   __init__.py40100% 
   edtf_exceptions.py151126%13–19, 22–24, 29
   grammar.py1281191%148–151, 350, 355–360
   parser_classes.py63335044%69, 71, 78–81, 83–84, 86–87, 110–112, 116, 119, 122, 181, 183, 190, 192, 198–202, 207–213, 220–224, 229–235, 246, 257, 286, 290, 302–304, 309, 317–319, 322, 337–338, 342, 371–375, 378, 383–384, 387, 390, 393, 396–400, 403–407, 427–429, 453, 457, 462, 464, 483, 490, 506, 515–517, 519–521, 524–525, 527, 530–533, 535, 537–539, 541, 545, 558, 565–568, 571, 574–577, 580–583, 585–589, 592–593, 596, 600, 606–607, 610, 613–614, 617, 621–622, 625–626, 629, 635, 640–641, 647, 649, 652–654, 660, 665–666, 669, 675, 677, 681–695, 700–702, 706, 708, 711–713, 717, 719, 722–724, 730–733, 738–739, 744–745, 747, 750, 753–755, 757, 760, 763–766, 768–774, 781–784, 786–792, 801–802, 805, 808, 811–813, 815, 823, 842–844, 846–849, 851–852, 854–855, 857, 859, 868, 871, 874, 881–882, 884–885, 887, 889, 891–892, 894, 896–901, 903, 905, 907–908, 910, 913–915, 918–920, 923–925, 933, 935–936, 939–940, 943–944, 947–948, 950–951, 955, 959–960, 963, 968–969, 973–974, 976–984, 986, 996–997, 999, 1001–1002, 1004, 1007, 1012, 1017, 1023–1024, 1027, 1030, 1033, 1035–1037, 1039, 1044–1045, 1047, 1056–1057, 1060, 1063, 1066–1067, 1069, 1078–1079, 1081–1083, 1085–1088, 1100–1102, 1107, 1110–1111, 1113, 1118
   tests.py89890%3–4, 6, 8–10, 26, 229, 243, 262, 284, 286–289, 291–293, 295–299, 302–303, 305–306, 309–311, 314–315, 318–321, 324, 327–331, 334, 337, 340, 343–348, 351, 354, 357, 362–363, 365–366, 369–370, 372–374, 377, 379–384, 386–393, 396–398, 400, 403–404, 410–414
edtf
   __init__.py40100% 
   appsettings.py28292%12–13
   convert.py631182%11–19, 21, 73
   fields.py1191190%1, 3–8, 10–13, 15, 23, 29, 31, 33–35, 38–39, 51–58, 60, 63, 65–70, 72–76, 78–79, 81, 83–84, 86, 88–89, 91, 93–95, 97–98, 100, 102–105, 107, 109–112, 114, 123–125, 128, 131–132, 135–136, 139–140, 142–144, 147, 151, 153, 155, 157, 160–173, 179, 181–182, 184–185, 190–191, 193–194, 196, 204, 206, 208–209, 212–213, 223–226, 234
   jdutil.py984455%37, 55, 91–92, 287, 291, 314, 316–317, 319, 321, 346, 348, 350, 370–372, 374, 376, 378, 381–383, 385, 387, 389, 392–393, 395, 397, 399–400, 402, 405–407, 410–413, 415, 417, 424, 431
   tests.py710100% 
edtf/natlang
   __init__.py20100% 
   en.py1471192%55, 58, 118, 164–165, 176–177, 203–204, 208, 275
   tests.py10190%211
edtf/parser
   __init__.py40100% 
   edtf_exceptions.py15286%24, 29
   grammar.py128298%357, 359
   parser_classes.py6339884%110–112, 119, 122, 183, 189–193, 200–202, 209–213, 222–224, 229–235, 246, 337–338, 371–375, 378, 393, 396–400, 403–407, 427–429, 545, 581, 589, 593, 640–641, 647, 665–666, 669, 675, 682, 684, 688, 695, 760, 766, 770, 784, 788, 882, 900–901, 903, 908, 914, 919, 924, 960, 963, 969, 974, 976–984, 999, 1004, 1081, 1085, 1118
   tests.py89198%400
TOTAL2822104063% 

Tests Skipped Failures Errors Time
279 0 💤 0 ❌ 0 🔥 6.562s ⏱️

Please sign in to comment.