def test_idx_filename_is_always_the_same(self, year, quarter): mf = MasterFilings(year=year, quarter=quarter) assert mf.idx_filename == "master.idx"
def test_good_quarters(self): for quarter in range(1, 5): mf = MasterFilings(year=2019, quarter=quarter) assert mf.quarter == quarter
def test_bad_quarter(self, bad_quarter, expected_error): with pytest.raises(expected_error): _ = MasterFilings(year=2020, quarter=bad_quarter)
def test_good_year(self): for year in range(1993, date.today().year + 1): mf = MasterFilings(year=year, quarter=1) assert mf.year == year
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
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