Skip to content

Instantly share code, notes, and snippets.

@ascott1
Created May 1, 2015 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ascott1/8c8301944368b73c08a9 to your computer and use it in GitHub Desktop.
Save ascott1/8c8301944368b73c08a9 to your computer and use it in GitHub Desktop.
@@ -275,6 +275,51 @@ class NoticeBuildTest(TestCase):
self.assertTrue(changes['node']['text'].strip(),
u'(c) More stuff')
+
+ def test_process_amendments_single_parent(self):
+ xml = u"""
+ <REGTEXT PART="1026" TITLE="12">
+ <AMDPAR>2. In Supplement I to Part 1026—Official Interpretations, under Section 1026.35—Requirements for Higher-Priced Mortgage Loans, 35(b)(2) Exemptions, Paragraph 35(b)(2)(iii), paragraph 1.iii is revised to read as follows:</AMDPAR>
+ <HD SOURCE="HD1">Supplement I to Part 1026&#x2014;Official Interpretations</HD>
+ <EXTRACT>
+ <STARS/>
+ <HD SOURCE="HD1">Subpart E-Special Rules for Certain Home Mortgage Transactions</HD>
+ <STARS/>
+ <HD SOURCE="HD2">Section 1026.35-Requirements for Higher-Priced Mortgage Loans</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b) Escrow Accounts</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b)(2) Exemptions</HD>
+ <STARS/>
+ <HD SOURCE="HD3">Paragraph 35(b)(2)(iii)</HD>
+ <P>1. Requirements for exemption. * * *</P>
+ <STARS/>
+ <STARS/>
+ <P>iii. As of the end of the preceding calendar year, the creditor had total assets that are less than the asset threshold for the relevant calendar year. For calendar year 2015, the asset threshold is $2,060,000,000. Creditors that had total assets of less than $2,060,000,000 on December 31, 2014, satisfy this criterion for purposes of the exemption during 2015. This asset threshold shall adjust automatically each year based on the year-to-year change in the average of the Consumer Price Index for Urban Wage Earners and Clerical Workers, not seasonally adjusted, for each 12-month period ending in November, with rounding to the nearest million dollars. The Bureau will publish notice of the asset threshold each year by amending this comment. For historical purposes, the prior asset thresholds were:</P>
+ <P>A. For calendar year 2013, the asset threshold was $2,000,000,000. Creditors that had total assets of less than $2,000,000,000 on December 31, 2012, satisfied this criterion for purposes of the exemption during 2013.</P>
:
diff --git a/tests/notice_build_tests.py b/tests/notice_build_tests.py
index b4ff735..a2bcecc 100644
--- a/tests/notice_build_tests.py
+++ b/tests/notice_build_tests.py
@@ -275,6 +275,51 @@ class NoticeBuildTest(TestCase):
self.assertTrue(changes['node']['text'].strip(),
u'(c) More stuff')
+
+ def test_process_amendments_single_parent(self):
+ xml = u"""
+ <REGTEXT PART="1026" TITLE="12">
+ <AMDPAR>2. In Supplement I to Part 1026—Official Interpretations, under Section 1026.35—Requirements for Higher-Priced Mortgage Loans, 35(b)(2) Exemptions, Paragraph 35(b)(2)(iii), paragraph 1.iii is revised to read as follows:</AMDPAR>
+ <HD SOURCE="HD1">Supplement I to Part 1026&#x2014;Official Interpretations</HD>
+ <EXTRACT>
+ <STARS/>
+ <HD SOURCE="HD1">Subpart E-Special Rules for Certain Home Mortgage Transactions</HD>
+ <STARS/>
+ <HD SOURCE="HD2">Section 1026.35-Requirements for Higher-Priced Mortgage Loans</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b) Escrow Accounts</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b)(2) Exemptions</HD>
+ <STARS/>
+ <HD SOURCE="HD3">Paragraph 35(b)(2)(iii)</HD>
+ <P>1. Requirements for exemption. * * *</P>
+ <STARS/>
+ <STARS/>
+ <P>iii. As of the end of the preceding calendar year, the creditor had total assets that are less than the asset threshold for the relevant calendar year. For calendar year 2015, the asset threshold is $2,060,000,000. Creditors that had total assets of less than $2,060,000,000 on December 31, 2014, satisfy this criterion for purposes of the exemption during 2015. This asset threshold shall adjust automatically each year based on the year-to-year change in the average of the Consumer Price Index for Urban Wage Earners and Clerical Workers, not seasonally adjusted, for each 12-month period ending in November, with rounding to the nearest million dollars. The Bureau will publish notice of the asset threshold each year by amending this comment. For historical purposes, the prior asset thresholds were:</P>
+ <P>A. For calendar year 2013, the asset threshold was $2,000,000,000. Creditors that had total assets of less than $2,000,000,000 on Decembercriterion for purposes of the exemption during 2013.</P>
:
diff --git a/tests/notice_build_tests.py b/tests/notice_build_tests.py
index b4ff735..a2bcecc 100644
--- a/tests/notice_build_tests.py
+++ b/tests/notice_build_tests.py
@@ -275,6 +275,51 @@ class NoticeBuildTest(TestCase):
self.assertTrue(changes['node']['text'].strip(),
u'(c) More stuff')
+
+ def test_process_amendments_single_parent(self):
+ xml = u"""
+ <REGTEXT PART="1026" TITLE="12">
+ <AMDPAR>2. In Supplement I to Part 1026—Official Interpretations, under Section 1026.35—Requirements for Higher-Priced Mortgage Loans, 35(b)(2) Exemptions, Paragraph 35(b)(2)(iii), paragraph 1.iii is revised to read as follows:</AMDPAR>
+ <HD SOURCE="HD1">Supplrt 1026&#x2014;Official Interpretations</HD>
+ <EXTRACT>
+ <STARS/>
+ <HD SOURCE="HD1">Subpart E-Special Rules for Certain Home Mortgage Transactions</HD>
+ <STARS/>
+ <HD SOURCE="HD2">Section 1026.35-Requirements for Higher-Priced Mortgage Loans</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b) Escrow Accounts</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b)(2) Exemptions</HD>
+ <STARS/>
+ <HD SOURCE="HD3">Paragraph 35(b)(2)(iii)</HD>
+ <P>1. Requirements for exemption. * * *</P>
+ <STARS/>
+ <STARS/>
+ <P>iii. of the preceding calendar year, the creditor had total assets that are less than the asset threshold for the relevant calendar year. For calendar year 2015, the asset threshold is $2,060,000,000. Creditors that had total assets of less than $2,060,000,000 on December 31, 2014, satisfy this criterion for purposes of the exemption during 2015. This asset threshold shall adjust automatically each year based on the year-to-year change in the average of the Consumer Price Index for Urban Wage Earners and Clerical Workers, not seasonally adjusted, for each 12-month period ending in November, with rounding to the nearest million dollars. The Bureau will publish notice of the asset threshold each year by amending this comment. For historical purposes, the prior asset thresholds were:</P>
+ <P>A. For calendar year 2013, the asset threshold was $2,000,000,000. Creditors that had total assets of less than $2,000,000,000 on December 31, 2012, satisfied this criterion for purposes of the exemption during 2013.</P>
+ <P>B. For calendar year 2014, the asset threshold was $2,028,000,000. Creditors that had total assets of less than $2,028,000,000 on December 31, 2013, satisfied this criterion for purposes of the exemption during 2014.</P>
:
diff --git a/tests/notice_build_tests.py b/tests/notice_build_tests.py
index b4ff735..a2bcecc 100644
--- a/tests/notice_build_tests.py
+++ b/tests/notice_build_tests.py
@@ -275,6 +275,51 @@ class NoticeBuildTest(TestCase):
self.assertTrue(changes['node']['text'].strip(),
u'(c) More stuff')
+
+ def test_process_amendments_single_parent(self):
+ xml = u"""
+ <REGTEXT PART="1026" TITLE="12">32m <AMDPAR>2. In Supplement I to Part 1026—Official Interpretations, under Section 1026.35—Requirements for Higher-Priced Mortgage Loans, 35(b)(2) Exemptions, Paragraph 35(b)(2)(iii), paragraph 1.iii is revised to read as follows:</AMDPAR>
+ <HD SOURCE="HD1">Supplement I to Part 1026&#x2014;Official Interpretations</HD>
+ <EXTRACT>
+ <STARS/>
+ <HD SOURCE="HD1">Subpart E-Special Rules for Certain Home Mortgage Transactions</HD>
+ <STARS/>
+ <HD SOURCE="HD2">Section 1026.35-Requirements for Higher-Priced Mortgage Loans</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b) Escrow Accounts</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b)(2) Exemptions</HD>
+ <STARS/>
+ <HD SOURCE="HD3">Paragraph 35(b)(2)(iii)</HD>
+ <P>1. Requirements for exemption. * * *</P>
+ <STARS/>
+ <STARS/>
+ <P>iii. As of the end of the preceding calendar year, the creditor had total assets that are less than the asset threshold for the relevant calendar year. For calendar year 2015, the asset threshold is $2,060,000,000. Creditors that had total assets of less than $2,060,000,000 on December 31, 2014, satisfy this criterion for purposes of the exemption during 2015. This asset threshold shall adjust automatically each year based on the year-to-year change in the average of the Consumer Price Index for Urban Wage Earners and Clerical Workers, not seasonally adjusted, for each 12-month period ending in November, with rounding to the nearest million dollars. The Bureau will publish notice of the asset threshold each year by amending this comment. For historical purposes, the prior asset thresholds were:</P>
+ <P>A. For calendar year 2013, the asset threshold was $2,000,000,000. Creditors that had total assets of less than $2,000,000,000 on December 31, 2012, satisfied this criterion for purposes of the exemption during 2013.</P>
+ <P>B. For calendar year 2014, the asset threshold was $2,028,000,000. Creditors that had total assets of less than $2,028,000,000 on December 31, 2013, satisfied this criterion for purposes of the exemption during 2014.</P>
+ <STARS/>
+ </EXTRACT>
+ </REGTEXT>"""
+
:
diff --git a/tests/notice_build_tests.py b/tests/notice_build_tests.py
index b4ff735..a2bcecc 100644
--- a/tests/notice_build_tests.py
+++ b/tests/notice_build_tests.py
@@ -275,6 +275,51 @@ class NoticeBuildTest(TestCase):
self.assertTrue(changes['node']['text'].strip(),
u'(c) More stuff')
+
+ def test_process_amendments_single_parent(self):
+ xml = u"""
+ <REGTEXT PART="1026" TITLE="12">
+ <AMDPAR>2. In Supplement I to Part 1026—Official Interpretations, under Section 1026.35—Requirements for Higher-Priced Mortgage Loans, 35(b)(2) Exemptions, Paragraph 35(b)(2)(iii), paragraph 1.iii is revised to read as follows:</AMDPAR>
+ <HD SOURCE="HD1">Supplement I to Part 1026&#x2014;Official Interpretations</HD>
+ <EXTRACT>
+ <STARS/>
+ <HD SOURCE="HD1">Subpart E-Special Rules for Certain Home Mortgage Transactions</HD>
+ <STARS/>
+ <HD SOURCE="HD2">Section 1026.35-Requirements for Higher-Priced Mortgage Loans</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b) Escrow Accounts</HD>
+ <STARS/>
+ <HD SOURCE="HD3">35(b)(2) Exemptions</HD>
+ <STARS/>
+ <HD SOURCE="HD3">Paragraph 35(b)(2)(iii)</HD>
+ <P>1. Requirements for exemption. * * *</P>
+ <STARS/>
+ <STARS/>
+ <P>iii. As of the end of the preceding calendar year, the creditor had total assets that are less than the asset threshold for the relevant calendar year. For calendar year 2015, the asset threshold is $2,060,000,000. Creditors that had total assets of less than $2,060,000,000 on December 31, 2014, satisfy this criterion for purposes of the exemption during 2015. This asset threshold shall adjust automatically each year based on the year-to-year change in the average of the Consumer Price Index for Urban Wage Earners and Clerical Workers, not seasonally adjusted, for each 12-month period ending in November, with rounding to the nearest million dollars. The Bureau will publish notice of the asset threshold each year by amending this comment. For historical purposes, the prior asset thresholds were:</P>
+ <P>A. For calendar year 2013, the asset threshold was $2,000,000,000. Creditors that had total assets of less than $2,000,000,000 on December 31, 2012, satisfied this criterion for purposes of the exemption during 2013.</P>
+ <P>B. For calendar year 2014, the asset threshold was $2,028,000,000. Creditors that had total assets of less than $2,028,000,000 on December 31, 2013, satisfied this criterion for purposes of the exemption during 2014.</P>
+ <STARS/>
+ </EXTRACT>
+ </REGTEXT>"""
+
+ notice_xml = etree.fromstring(xml)
+ notice = {'cfr_parts': ['1026']}
+ build.process_amendments(notice, notice_xml)
+
+ import pprint
+ pp = pprint.PrettyPrinter(indent=4)
+ pp.pprint(notice)
+
+ #self.assertEqual(notice['changes'].keys(), ['1026-35-b-2-iii-Interp'])
+
+ #self.assertEqual(3, len(notice['amendments']))
+ #iii, a = notice['amendments']
+ #self.assertEqual(iii.action, 'PUT')
+ #self.assertEqual(a.action, 'PUT')
+ #self.assertEqual(iii.label, ['35', 'b', '3', 'iii' 'Interp', '1', 'iii'])
+ #35-b-2-iii-Interp-1-iii
+
+
def test_process_amendments_restart_new_section(self):
xml = u"""
<ROOT>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment