| Total Complexity | 0 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import pytest |
||
| 2 | |||
| 3 | |||
| 4 | class TestWebResource: |
||
| 5 | pass |
||
| 6 | # TODO: certificate problem |
||
| 7 | """" |
||
| 8 | def test(self): |
||
| 9 | # TODO incomplete coverage |
||
| 10 | path = Path("tt.txt.gz") |
||
| 11 | t = WebResource( |
||
| 12 | "https://www.proteinatlas.org/download/normal_tissue.tsv.zip", |
||
| 13 | "normal_tissue.tsv", |
||
| 14 | path, |
||
| 15 | ) |
||
| 16 | try: |
||
| 17 | t.download(redownload=True) |
||
| 18 | |||
| 19 | df = pd.read_csv(path, sep="\t") |
||
| 20 | # note: this isn't a great test; the # of rows can change |
||
| 21 | assert len(df) == 1118517 |
||
| 22 | assert t.datetime_downloaded() |
||
| 23 | assert t.exists() |
||
| 24 | t.delete() |
||
| 25 | assert not t.exists() |
||
| 26 | finally: |
||
| 27 | if path.exists(): |
||
| 28 | try: |
||
| 29 | path.unlink() |
||
| 30 | except OSError: |
||
| 31 | print(f"Warning: could not delete {path.absolute()}") |
||
| 32 | """ |
||
| 33 | |||
| 34 | |||
| 35 | if __name__ == "__main__": |
||
| 36 | pytest.main() |
||
| 37 |