Exemple #1
0
    def __init__(self, sane_json_path: str):
        with open(sane_json_path, 'r') as f:
            self.json_data = json.load(f)

        # Remove the logos
        self.json_data = remove_first_logos(self.json_data)

        # Transform the json if it is an old json's json
        if self.is_old_json_format():
            self.json_data = transform_old_json_format(self.json_data)

        self.json_data = general_json_fixes(self.json_data)
        self.sane_json = SaneJson(self.json_data)
def test_remove_first_logos_initial_logo():
    json = get_mock('logo_removal4.json')
    assert len(remove_first_logos(json)) == 3
def test_remove_first_logos_all_removal():
    json = get_mock('logo_removal3.json')
    assert len(remove_first_logos(json)) == 0