예제 #1
0
 def test_idx_filename_is_always_the_same(self, year, quarter):
     mf = MasterFilings(year=year, quarter=quarter)
     assert mf.idx_filename == "master.idx"
예제 #2
0
 def test_good_quarters(self):
     for quarter in range(1, 5):
         mf = MasterFilings(year=2019, quarter=quarter)
         assert mf.quarter == quarter
예제 #3
0
 def test_bad_quarter(self, bad_quarter, expected_error):
     with pytest.raises(expected_error):
         _ = MasterFilings(year=2020, quarter=bad_quarter)
예제 #4
0
 def test_good_year(self):
     for year in range(1993, date.today().year + 1):
         mf = MasterFilings(year=year, quarter=1)
         assert mf.year == year
예제 #5
0
 def test_clean_path(self, original_path, clean_path):
     master_filing = MasterFilings(year=2000, quarter=1)
     assert master_filing.clean_directory_path(original_path) == clean_path
예제 #6
0
 def test_always_false_entry_filter(self, mock_master_idx_file):
     master_filing = MasterFilings(year=1993,
                                   quarter=4,
                                   entry_filter=lambda _: False)
     urls = master_filing.get_urls()
     assert len(urls) == 0