def test_run_importer_no_args(self):
     with self.assertRaises(SystemExit):
         run()
 def test_run_importer_non_cfpb_part_args(self):
     """The Part number must be on our whitelist"""
     with self.assertRaises(ValueError):
         run('9999')
     with self.assertRaises(ValueError):
         run('DROP TABLE')
 def test_run_all(self, mock_importer):
     run('ALL')
     self.assertEqual(mock_importer.call_count, 11)
 def test_run_all_with_local_file(self, mock_importer):
     run('ALL', '/mock/local/file.xml')
     self.assertEqual(mock_importer.call_count, 11)
 def test_run_with_one_arg_calls_importer(self, mock_importer):
     run('1002')
     self.assertEqual(mock_importer.call_count, 1)
 def test_run_works_with_local_file(self, mock_importer):
     run('1002', '/mock/local/file.xml')
     self.assertEqual(mock_importer.call_count, 1)
 def test_run_importer_non_cfpb_part_args(self):
     """The Part number must be on our whitelist"""
     with self.assertRaises(ValueError):
         ecfr_importer.run('9999')
     with self.assertRaises(ValueError):
         ecfr_importer.run('DROP TABLE')
 def test_run_importer_no_args(self):
     with self.assertRaises(SystemExit):
         ecfr_importer.run()
 def test_run_all_with_local_file(self, mock_importer):
     ecfr_importer.run('ALL', '/mock/local/file.xml')
     self.assertEqual(mock_importer.call_count, 11)
 def test_run_all(self, mock_importer):
     ecfr_importer.run('ALL')
     self.assertEqual(mock_importer.call_count, 11)
 def test_run_with_one_arg_calls_importer(self, mock_importer):
     ecfr_importer.run('1002')
     self.assertEqual(mock_importer.call_count, 1)