This repository has been archived by the owner on Apr 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #330 from cmc333333/37-42-fixes
Fixes for 37 CFR 42 history
- Loading branch information
Showing
18 changed files
with
173 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,33 @@ | ||
from unittest import TestCase | ||
|
||
from regparser.commands import import_notice | ||
from regparser.notice.xml import NoticeXML | ||
from regparser.test_utils.xml_builder import XMLBuilder | ||
|
||
|
||
class CommandsImportNoticeTests(TestCase): | ||
def test_has_requirments(self): | ||
"""Validate that certain attributes are required""" | ||
with XMLBuilder("ROOT", **{"eregs-version-id": "vvv"}) as ctx: | ||
ctx.PRTPAGE(P=44, **{"eregs-fr-volume": "124"}) | ||
ctx.DATES(**{"eregs-published-date": "2005-05-05"}) | ||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
self.assertTrue(import_notice.has_requirements(notice_xml)) | ||
def test_has_requirments(): | ||
"""Validate that certain attributes are required""" | ||
root_attrs = { | ||
"eregs-version-id": "vvv", | ||
"fr-volume": 124, | ||
"fr-start-page": 44, | ||
"fr-end-page": 55 | ||
} | ||
with XMLBuilder("ROOT", **root_attrs) as ctx: | ||
ctx.DATES(**{"eregs-published-date": "2005-05-05"}) | ||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
assert import_notice.has_requirements(notice_xml) | ||
|
||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.attrib['eregs-version-id'] | ||
assert not import_notice.has_requirements(notice_xml) | ||
|
||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.attrib['eregs-version-id'] | ||
self.assertFalse(import_notice.has_requirements(notice_xml)) | ||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.attrib['fr-volume'] | ||
assert not import_notice.has_requirements(notice_xml) | ||
|
||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.xpath('//PRTPAGE')[0].attrib['eregs-fr-volume'] | ||
self.assertFalse(import_notice.has_requirements(notice_xml)) | ||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.attrib['fr-start-page'] | ||
assert not import_notice.has_requirements(notice_xml) | ||
|
||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.xpath('//DATES')[0].attrib['eregs-published-date'] | ||
self.assertFalse(import_notice.has_requirements(notice_xml)) | ||
notice_xml = NoticeXML(ctx.xml_copy()) | ||
del notice_xml.xml.xpath('//DATES')[0].attrib['eregs-published-date'] | ||
assert not import_notice.has_requirements(notice_xml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.