diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 17:55:15 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2021-11-02 17:55:22 -0700 |
commit | 6fa2d38be243531747241a3ae602069d507368d9 (patch) | |
tree | 7cc81446a97a372640f6a189f09b88fa466e77ce /python/tests | |
parent | 367b06f64546e4533662017c9dbe72aca175a294 (diff) | |
download | fatcat-6fa2d38be243531747241a3ae602069d507368d9.tar.gz fatcat-6fa2d38be243531747241a3ae602069d507368d9.zip |
lint: simple, safe inline lint fixes
'==' vs 'is'; 'not a in b' vs 'a not in b'; etc
Diffstat (limited to 'python/tests')
-rw-r--r-- | python/tests/api_filesets.py | 2 | ||||
-rw-r--r-- | python/tests/citation_efficiency.py | 4 | ||||
-rw-r--r-- | python/tests/clean_files.py | 2 | ||||
-rw-r--r-- | python/tests/import_arxiv.py | 8 | ||||
-rw-r--r-- | python/tests/import_common.py | 6 | ||||
-rw-r--r-- | python/tests/import_crossref.py | 2 | ||||
-rw-r--r-- | python/tests/import_datacite.py | 18 | ||||
-rw-r--r-- | python/tests/import_doaj.py | 14 | ||||
-rw-r--r-- | python/tests/import_grobid_metadata.py | 6 | ||||
-rw-r--r-- | python/tests/import_ingest.py | 2 | ||||
-rw-r--r-- | python/tests/import_jalc.py | 4 | ||||
-rw-r--r-- | python/tests/import_jstor.py | 14 | ||||
-rw-r--r-- | python/tests/import_pubmed.py | 22 | ||||
-rw-r--r-- | python/tests/importer.py | 22 | ||||
-rw-r--r-- | python/tests/transform_elasticsearch.py | 120 | ||||
-rw-r--r-- | python/tests/web_citation_csl.py | 2 | ||||
-rw-r--r-- | python/tests/web_entity_views.py | 2 |
17 files changed, 125 insertions, 125 deletions
diff --git a/python/tests/api_filesets.py b/python/tests/api_filesets.py index c69d567d..f351dc9f 100644 --- a/python/tests/api_filesets.py +++ b/python/tests/api_filesets.py @@ -80,7 +80,7 @@ def test_fileset_examples(api): assert fs3.urls[1].rel == 'archive' assert fs3.manifest[1].md5 == 'f4de91152c7ab9fdc2a128f962faebff' assert fs3.manifest[1].mimetype == 'application/gzip' - assert fs3.manifest[1].extra != None + assert fs3.manifest[1].extra is not None assert fs3.releases[0].ident assert fs3.releases[0].abstracts is None assert fs3.releases[0].refs is None diff --git a/python/tests/citation_efficiency.py b/python/tests/citation_efficiency.py index f8807db6..1d57dfeb 100644 --- a/python/tests/citation_efficiency.py +++ b/python/tests/citation_efficiency.py @@ -58,7 +58,7 @@ def test_citation_targets(api): assert r2.refs[1].key == "second" assert r2.refs[0].index == 0 # TODO: one-indexing? assert r2.refs[1].index == 1 - assert r2.refs[0].target_release_id == None + assert r2.refs[0].target_release_id is None assert r2.refs[1].target_release_id == r1.ident assert len(r2.refs) == 2 @@ -81,7 +81,7 @@ def test_citation_empty_array(api): assert r1.refs == r2.refs r1b = api.get_release(r1.ident, hide="refs") - assert r1b.refs == None + assert r1b.refs is None def test_citation_encoding(api): # escape-only changes (eg, \u1234 whatever for ASCII) diff --git a/python/tests/clean_files.py b/python/tests/clean_files.py index ce1102be..f752bc2c 100644 --- a/python/tests/clean_files.py +++ b/python/tests/clean_files.py @@ -28,7 +28,7 @@ def test_url_cleanups(file_cleaner): # remove None wayback links assert len(f.urls) == 2 for u in f.urls: - assert not 'web/None' in u.url + assert 'web/None' not in u.url assert f == file_cleaner.clean_entity(f) assert f == file_cleaner.clean_entity(copy.deepcopy(f)) diff --git a/python/tests/import_arxiv.py b/python/tests/import_arxiv.py index 9306e67c..3ed1ab29 100644 --- a/python/tests/import_arxiv.py +++ b/python/tests/import_arxiv.py @@ -50,8 +50,8 @@ def test_arxiv_xml_parse(arxiv_importer): print(r2.extra) assert r1.work_id == r2.work_id assert r1.title == "Martingale theory for housekeeping heat" - assert r1.subtitle == None - assert r1.original_title == None + assert r1.subtitle is None + assert r1.original_title is None assert r1.release_type == "article" assert r1.release_stage == "submitted" assert r2.release_stage == "accepted" @@ -60,7 +60,7 @@ def test_arxiv_xml_parse(arxiv_importer): assert r2.version == "v2" assert r1.ext_ids.arxiv == "1810.09584v1" assert r2.ext_ids.arxiv == "1810.09584v2" - assert r1.ext_ids.doi == None + assert r1.ext_ids.doi is None assert r2.ext_ids.doi == "10.1209/0295-5075/124/60006" assert r1.release_year == 2018 assert str(r1.release_date) == "2018-10-22" @@ -71,7 +71,7 @@ def test_arxiv_xml_parse(arxiv_importer): assert len(r1.contribs) == 4 assert r1.extra['arxiv']['categories'] == ['cond-mat.stat-mech', 'physics.bio-ph', 'physics.data-an'] assert r1.extra['arxiv']['base_id'] == '1810.09584' - assert r1.extra['superceded'] == True + assert r1.extra['superceded'] is True assert r1.contribs[0].raw_name == "Raphael Chetrite" assert r1.contribs[0].role == "author" diff --git a/python/tests/import_common.py b/python/tests/import_common.py index d0db014e..69e51432 100644 --- a/python/tests/import_common.py +++ b/python/tests/import_common.py @@ -37,7 +37,7 @@ def test_fuzzy_match_none(entity_importer, mocker) -> None: ) resp = entity_importer.match_existing_release_fuzzy(release) - assert resp == None + assert resp is None def test_fuzzy_match_different(entity_importer, mocker) -> None: """ @@ -71,8 +71,8 @@ def test_fuzzy_match_different(entity_importer, mocker) -> None: match_raw.side_effect = [[r3]] resp = entity_importer.match_existing_release_fuzzy(r1) - assert resp == None + assert resp is None match_raw.side_effect = [[]] resp = entity_importer.match_existing_release_fuzzy(r1) - assert resp == None + assert resp is None diff --git a/python/tests/import_crossref.py b/python/tests/import_crossref.py index ebe6942f..a2c8681b 100644 --- a/python/tests/import_crossref.py +++ b/python/tests/import_crossref.py @@ -87,7 +87,7 @@ def test_crossref_dict_parse(crossref_importer): assert r.ext_ids.doi == "10.1002/(sici)1097-461x(1998)66:4<261::aid-qua1>3.0.co;2-t" assert r.ext_ids.isbn13 == "978-3-16-148410-0" assert r.language == "fr" - assert r.subtitle == None + assert r.subtitle is None assert 'subtitle' not in r.extra assert 'subtitle' not in r.extra['crossref'] assert 'funder' not in r.extra diff --git a/python/tests/import_datacite.py b/python/tests/import_datacite.py index edbb6617..a92a732d 100644 --- a/python/tests/import_datacite.py +++ b/python/tests/import_datacite.py @@ -323,7 +323,7 @@ def test_datacite_spammy_title(datacite_importer): Heroes: Rising [2020]Full Movie Watch Online And Free Download""", "attributes": {"doi": "10.1234/1234"}}) - assert r == False + assert r is False def test_datacite_importer(datacite_importer): last_index = datacite_importer.api.get_changelog(limit=1)[0].index @@ -367,13 +367,13 @@ def test_datacite_dict_parse(datacite_importer): ) assert r.release_type == "article" assert r.release_stage == "published" - assert r.license_slug == None - assert r.original_title == None + assert r.license_slug is None + assert r.original_title is None assert r.ext_ids.doi == "10.18730/8dym9" - assert r.ext_ids.isbn13 == None + assert r.ext_ids.isbn13 is None assert r.language == "en" - assert r.subtitle == None - assert r.release_date == None + assert r.subtitle is None + assert r.release_date is None assert r.release_year == 1986 assert "subtitle" not in r.extra assert "subtitle" not in r.extra["datacite"] @@ -388,10 +388,10 @@ def test_datacite_dict_parse(datacite_importer): assert len(r.abstracts[0].content) == 421 assert len(r.contribs) == 2 assert r.contribs[0].raw_name == "GLIS Of The ITPGRFA" - assert r.contribs[0].given_name == None - assert r.contribs[0].surname == None + assert r.contribs[0].given_name is None + assert r.contribs[0].surname is None assert len(r.refs) == 0 - assert r.version == None + assert r.version is None def test_datacite_conversions(datacite_importer): diff --git a/python/tests/import_doaj.py b/python/tests/import_doaj.py index 17a23257..72a3acb8 100644 --- a/python/tests/import_doaj.py +++ b/python/tests/import_doaj.py @@ -128,16 +128,16 @@ def test_doaj_dict_parse(doaj_importer): assert r.release_type == "article-journal" assert r.release_stage == "published" assert r.license_slug == "cc-by-nc-nd" - assert r.original_title == None + assert r.original_title is None assert r.ext_ids.doi == "10.1016/j.matdes.2016.06.110" assert r.ext_ids.doaj == "e58f08a11ecb495ead55a44ad4f89808" - assert r.subtitle == None - assert r.release_date == None + assert r.subtitle is None + assert r.release_date is None assert r.release_year == 2016 assert r.volume == "108" - assert r.number == None + assert r.number is None assert r.pages == "608-617" - assert r.version == None + assert r.version is None assert r.language == "en" # matched by ISSN, so wouldn't be defined normally assert r.extra['container_name'] == "Materials & Design" @@ -145,8 +145,8 @@ def test_doaj_dict_parse(doaj_importer): assert len(r.abstracts[0].content) == 1033 assert len(r.contribs) == 5 assert r.contribs[0].raw_name == "Xinfeng Li" - assert r.contribs[0].given_name == None - assert r.contribs[0].surname == None + assert r.contribs[0].given_name is None + assert r.contribs[0].surname is None assert not r.refs #print(r.extra) diff --git a/python/tests/import_grobid_metadata.py b/python/tests/import_grobid_metadata.py index 52284b89..87cb8ef0 100644 --- a/python/tests/import_grobid_metadata.py +++ b/python/tests/import_grobid_metadata.py @@ -28,9 +28,9 @@ def test_grobid_metadata_parse(grobid_metadata_importer): assert re.contribs[0].raw_name == "Wahyu Ary" assert re.contribs[0].given_name == "Wahyu" assert re.contribs[0].surname == "Ary" - assert re.publisher == None + assert re.publisher is None if re.extra: - assert re.extra.get('container_name') == None + assert re.extra.get('container_name') is None assert len(re.refs) == 27 def test_file_metadata_parse(grobid_metadata_importer): @@ -43,7 +43,7 @@ def test_file_metadata_parse(grobid_metadata_importer): random_sha1, json.loads(raw[1]), raw[2], int(raw[3])) assert fe #assert fe.sha1 == "d4a841744719518bf8bdd5d91576ccedc55efbb5" # "sha1:2SUEC5CHDFIYX6F52XMRK5WM5XCV565V" - assert fe.md5 == None + assert fe.md5 is None assert fe.mimetype == "application/pdf" assert fe.size == 142710 assert fe.urls[1].url.startswith("http://via.library.depaul.edu") diff --git a/python/tests/import_ingest.py b/python/tests/import_ingest.py index 92539f1a..955c97cb 100644 --- a/python/tests/import_ingest.py +++ b/python/tests/import_ingest.py @@ -155,7 +155,7 @@ def test_ingest_dict_parse_old(ingest_importer): # ancient ingest requests had no type; skip them f = ingest_importer.parse_record(raw) - assert f == None + assert f is None raw['request']['ingest_type'] = 'pdf' f = ingest_importer.parse_record(raw) diff --git a/python/tests/import_jalc.py b/python/tests/import_jalc.py index ff757e51..010dfce8 100644 --- a/python/tests/import_jalc.py +++ b/python/tests/import_jalc.py @@ -77,12 +77,12 @@ def test_jalc_xml_parse(jalc_importer): print(r.extra) assert r.title == "New carbides in the Ni-Ti-Mo-C system" - assert r.subtitle == None + assert r.subtitle is None assert r.original_title == "Ni-Ti-Mo-C系に出現する新炭化物相について" assert r.publisher == "Japan Society of Powder and Powder Metallurgy" assert r.release_type == "article-journal" assert r.release_stage == "published" - assert r.license_slug == None + assert r.license_slug is None assert r.ext_ids.doi == "10.2497/jjspm.36.898" assert r.language == "ja" assert r.volume == "36" diff --git a/python/tests/import_jstor.py b/python/tests/import_jstor.py index 8494ffb2..25a904a0 100644 --- a/python/tests/import_jstor.py +++ b/python/tests/import_jstor.py @@ -50,20 +50,20 @@ def test_jstor_xml_parse(jstor_importer): print(r.extra) assert r.title == "On the Universal Law of Attraction, Including that of Gravitation, as a Particular Case of Approximation Deducible from the Principle that Equal and Similar Particles of Matter Move Similarly, Relatively to Each other. [Abstract]" - assert r.subtitle == None - assert r.original_title == None + assert r.subtitle is None + assert r.original_title is None assert r.publisher == "The Royal Society" assert r.release_type == "abstract" assert r.release_stage == "published" - assert r.license_slug == None - assert r.ext_ids.doi == None + assert r.license_slug is None + assert r.ext_ids.doi is None assert r.ext_ids.jstor == "111039" assert r.language == "en" assert r.volume == "5" - assert r.issue == None + assert r.issue is None assert r.pages == "831-832" # None because jan 1st - assert r.release_date == None + assert r.release_date is None assert r.release_year == 1843 # matched by ISSN, so shouldn't be in there? #assert extra['container_name'] == "Abstracts of the Papers Communicated to the Royal Society of London" @@ -74,4 +74,4 @@ def test_jstor_xml_parse(jstor_importer): assert r.contribs[0].given_name == "John Kinnersley" assert r.contribs[0].surname == "Smythies" - assert r.refs == None + assert r.refs is None diff --git a/python/tests/import_pubmed.py b/python/tests/import_pubmed.py index 10ded3fc..8b5ff3e5 100644 --- a/python/tests/import_pubmed.py +++ b/python/tests/import_pubmed.py @@ -50,19 +50,19 @@ def test_pubmed_xml_parse(pubmed_importer): r2 = pubmed_importer.parse_record(soup.find_all("PubmedArticle")[-1]) assert r1.title == "Hospital debt management and cost reimbursement" - assert r1.subtitle == None - assert r1.original_title == None - assert r1.publisher == None + assert r1.subtitle is None + assert r1.original_title is None + assert r1.publisher is None assert r1.release_type == "article-journal" assert r1.release_stage == "published" - assert r1.license_slug == None - assert r1.ext_ids.doi == None + assert r1.license_slug is None + assert r1.ext_ids.doi is None assert r1.ext_ids.pmid == "973217" assert r1.language == "en" assert r1.volume == "3" assert r1.issue == "1" assert r1.pages == "69-81" - assert r1.release_date == None # not "1976-12-03", which is medline ingest date + assert r1.release_date is None # not "1976-12-03", which is medline ingest date assert r1.release_year == 1976 # matched by ISSN, so shouldn't be in there? #assert extra['container_name'] == "Abstracts of the Papers Communicated to the Royal Society of London" @@ -77,18 +77,18 @@ def test_pubmed_xml_parse(pubmed_importer): assert not r1.refs assert r2.title == "Synthesis and Antibacterial Activity of Metal(loid) Nanostructures by Environmental Multi-Metal(loid) Resistant Bacteria and Metal(loid)-Reducing Flavoproteins" - assert r2.subtitle == None - assert r2.original_title == None - assert r2.publisher == None + assert r2.subtitle is None + assert r2.original_title is None + assert r2.publisher is None assert r2.release_type == "article-journal" assert r2.release_stage == "published" - assert r2.license_slug == None + assert r2.license_slug is None assert r2.ext_ids.doi == "10.3389/fmicb.2018.00959" assert r2.ext_ids.pmid == "29869640" assert r2.ext_ids.pmcid == "PMC5962736" assert r2.language == "en" assert r2.volume == "9" - assert r2.issue == None + assert r2.issue is None assert r2.pages == "959" assert str(r2.release_date) == "2018-05-15" assert r2.release_year == 2018 diff --git a/python/tests/importer.py b/python/tests/importer.py index a412b247..40bd8cba 100644 --- a/python/tests/importer.py +++ b/python/tests/importer.py @@ -9,24 +9,24 @@ def test_issnl_mapping_lookup(api): assert fi.issn2issnl('0000-0027') == '0002-0027' assert fi.issn2issnl('0002-0027') == '0002-0027' - assert fi.issn2issnl('9999-0027') == None + assert fi.issn2issnl('9999-0027') is None - assert fi.lookup_issnl('9999-9999') == None + assert fi.lookup_issnl('9999-9999') is None def test_identifiers(api): with open('tests/files/ISSN-to-ISSN-L.snip.txt', 'r') as issn_file: ci = CrossrefImporter(api, issn_map_file=issn_file) - assert ci.is_issnl("1234-5678") == True - assert ci.is_issnl("1234-5678.") == False - assert ci.is_issnl("12345678") == False - assert ci.is_issnl("1-2345678") == False + assert ci.is_issnl("1234-5678") is True + assert ci.is_issnl("1234-5678.") is False + assert ci.is_issnl("12345678") is False + assert ci.is_issnl("1-2345678") is False oi = OrcidImporter(api) - assert oi.is_orcid("0000-0003-3118-6591") == True - assert oi.is_orcid("0000-0003-3953-765X") == True - assert oi.is_orcid("0000-00x3-3118-659") == False - assert oi.is_orcid("0000-00033118-659") == False - assert oi.is_orcid("0000-0003-3118-659.") == False + assert oi.is_orcid("0000-0003-3118-6591") is True + assert oi.is_orcid("0000-0003-3953-765X") is True + assert oi.is_orcid("0000-00x3-3118-659") is False + assert oi.is_orcid("0000-00033118-659") is False + assert oi.is_orcid("0000-0003-3118-659.") is False diff --git a/python/tests/transform_elasticsearch.py b/python/tests/transform_elasticsearch.py index c11c5972..cee37867 100644 --- a/python/tests/transform_elasticsearch.py +++ b/python/tests/transform_elasticsearch.py @@ -83,15 +83,15 @@ def test_rich_elasticsearch_convert(): assert es['ref_linked_count'] == 1 assert es['preservation'] == "bright" - assert es['is_oa'] == True - assert es['is_longtail_oa'] == False - assert es['is_preserved'] == True - assert es['in_web'] == True - assert es['in_dweb'] == True - assert es['in_ia'] == True - assert es['in_ia_sim'] == False - assert es['in_kbart'] == True - assert es['in_jstor'] == True + assert es['is_oa'] is True + assert es['is_longtail_oa'] is False + assert es['is_preserved'] is True + assert es['in_web'] is True + assert es['in_dweb'] is True + assert es['in_ia'] is True + assert es['in_ia_sim'] is False + assert es['in_kbart'] is True + assert es['in_jstor'] is True def test_elasticsearch_release_from_json(): r = entity_from_json(open('./tests/files/release_etodop5banbndg3faecnfm6ozi.json', 'r').read(), ReleaseEntity) @@ -103,18 +103,18 @@ def test_elasticsearch_release_from_json(): assert es['first_page'] == "1404" assert es['issue'] == "11" assert es['volume'] == "118" - assert es['number'] == None + assert es['number'] is None assert es['preservation'] == "dark" - assert es['is_oa'] == False - assert es['is_longtail_oa'] == False - assert es['is_preserved'] == True - assert es['in_web'] == False - assert es['in_dweb'] == False - assert es['in_ia'] == False - assert es['in_ia_sim'] == True - assert es['in_kbart'] == True - assert es['in_jstor'] == False + assert es['is_oa'] is False + assert es['is_longtail_oa'] is False + assert es['is_preserved'] is True + assert es['in_web'] is False + assert es['in_dweb'] is False + assert es['in_ia'] is False + assert es['in_ia_sim'] is True + assert es['in_kbart'] is True + assert es['in_jstor'] is False # this release has a fileset, and no file r = entity_from_json(open('./tests/files/release_3mssw2qnlnblbk7oqyv2dafgey.json', 'r').read(), ReleaseEntity) @@ -127,15 +127,15 @@ def test_elasticsearch_release_from_json(): assert es['webcapture_count'] == 0 assert es['preservation'] == "dark" - assert es['is_oa'] == True - assert es['is_longtail_oa'] == False - assert es['is_preserved'] == True - assert es['in_web'] == True - assert es['in_dweb'] == True - assert es['in_ia'] == False - assert es['in_ia_sim'] == False - assert es['in_kbart'] == False - assert es['in_jstor'] == False + assert es['is_oa'] is True + assert es['is_longtail_oa'] is False + assert es['is_preserved'] is True + assert es['in_web'] is True + assert es['in_dweb'] is True + assert es['in_ia'] is False + assert es['in_ia_sim'] is False + assert es['in_kbart'] is False + assert es['in_jstor'] is False # this release has a web capture, and no file (edited the JSON to remove file) r = entity_from_json(open('./tests/files/release_mjtqtuyhwfdr7j2c3l36uor7uy.json', 'r').read(), ReleaseEntity) @@ -148,15 +148,15 @@ def test_elasticsearch_release_from_json(): assert es['webcapture_count'] == 1 assert es['preservation'] == "bright" - assert es['is_oa'] == True - assert es['is_longtail_oa'] == False - assert es['is_preserved'] == True - assert es['in_web'] == True - assert es['in_dweb'] == False - assert es['in_ia'] == True - assert es['in_ia_sim'] == False - assert es['in_kbart'] == False - assert es['in_jstor'] == False + assert es['is_oa'] is True + assert es['is_longtail_oa'] is False + assert es['is_preserved'] is True + assert es['in_web'] is True + assert es['in_dweb'] is False + assert es['in_ia'] is True + assert es['in_ia_sim'] is False + assert es['in_kbart'] is False + assert es['in_jstor'] is False def test_elasticsearch_container_transform(journal_metadata_importer): with open('tests/files/journal_metadata.sample.json', 'r') as f: @@ -200,7 +200,7 @@ def test_elasticsearch_container_transform(journal_metadata_importer): assert es['name'] == c2.name assert es['publisher'] == c2.publisher assert es['keepers'] == list(c2.extra['kbart'].keys()) == ["portico"] - assert es['any_kbart'] == True + assert es['any_kbart'] is True def test_elasticsearch_file_transform(): @@ -219,7 +219,7 @@ def test_elasticsearch_file_transform(): assert es['md5'] == fe.md5 # pylint: disable=no-member assert es['size_bytes'] == fe.size # pylint: disable=no-member assert es['mimetype'] == fe.mimetype # pylint: disable=no-member - assert es['in_ia'] == True + assert es['in_ia'] is True assert 'web' in es['rels'] assert 'www.zhros.ru' in es['hosts'] @@ -227,7 +227,7 @@ def test_elasticsearch_file_transform(): assert 'archive.org' in (es['hosts'] + es['domains']) assert 'web.archive.org' in (es['hosts'] + es['domains']) # old regression - assert not '.archive.org' in (es['hosts'] + es['domains']) + assert '.archive.org' not in (es['hosts'] + es['domains']) def test_elasticsearch_changelog_transform(): ce = entity_from_json(open('./tests/files/changelog_3469683.json', 'r').read(), ChangelogEntry) @@ -238,8 +238,8 @@ def test_elasticsearch_changelog_transform(): assert es['timestamp'][:19] == "2020-01-30T05:04:39.738601Z"[:19] assert es['editor_id'] == "scmbogxw25evtcesfcab5qaboa" assert es['username'] == "crawl-bot" - assert es['is_bot'] == True - assert es['is_admin'] == True + assert es['is_bot'] is True + assert es['is_admin'] is True assert es['agent'] == "fatcat_tools.IngestFileResultImporter" assert es['total'] == 50 @@ -279,15 +279,15 @@ def test_elasticsearch_release_kbart_year(): assert es['release_year'] == this_year assert es['preservation'] == "none" - assert es['is_oa'] == True - assert es['is_longtail_oa'] == False - assert es['is_preserved'] == False - assert es['in_web'] == False - assert es['in_dweb'] == False - assert es['in_ia'] == False - assert es['in_ia_sim'] == False - assert es['in_kbart'] == False - assert es['in_jstor'] == False + assert es['is_oa'] is True + assert es['is_longtail_oa'] is False + assert es['is_preserved'] is False + assert es['in_web'] is False + assert es['in_dweb'] is False + assert es['in_ia'] is False + assert es['in_ia_sim'] is False + assert es['in_kbart'] is False + assert es['in_jstor'] is False r.container = ContainerEntity( name="dummy journal", @@ -303,12 +303,12 @@ def test_elasticsearch_release_kbart_year(): assert es['release_year'] == this_year assert es['preservation'] == "dark" - assert es['is_oa'] == True - assert es['is_longtail_oa'] == False - assert es['is_preserved'] == True - assert es['in_web'] == False - assert es['in_dweb'] == False - assert es['in_ia'] == False - assert es['in_ia_sim'] == False - assert es['in_kbart'] == True - assert es['in_jstor'] == False + assert es['is_oa'] is True + assert es['is_longtail_oa'] is False + assert es['is_preserved'] is True + assert es['in_web'] is False + assert es['in_dweb'] is False + assert es['in_ia'] is False + assert es['in_ia_sim'] is False + assert es['in_kbart'] is True + assert es['in_jstor'] is False diff --git a/python/tests/web_citation_csl.py b/python/tests/web_citation_csl.py index 50a2d6e8..a72742cb 100644 --- a/python/tests/web_citation_csl.py +++ b/python/tests/web_citation_csl.py @@ -47,7 +47,7 @@ def test_release_bibtex(app, api): rv = app.get('/release/{}'.format(r1edit.ident)) assert rv.status_code == 200 - assert not b'BibTeX' in rv.data + assert b'BibTeX' not in rv.data with pytest.raises(ValueError): rv = app.get('/release/{}.bib'.format(r1edit.ident)) diff --git a/python/tests/web_entity_views.py b/python/tests/web_entity_views.py index 4068a0c7..45fd3e9a 100644 --- a/python/tests/web_entity_views.py +++ b/python/tests/web_entity_views.py @@ -332,7 +332,7 @@ def test_web_release_login(full_app, app_admin): rv = app_admin.post('/release/create', data=form.data, follow_redirects=True) assert rv.status_code == 400 assert b'My Research: Missing Some Stuff' in rv.data - assert not b'already' in rv.data + assert b'already' not in rv.data with full_app.test_request_context(): form = ReleaseEntityForm() |