Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test to make sure cheat sheet version is up to date
- Loading branch information
1 parent
4c84a5c
commit cb807af
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pandas as pd | ||
import xarray as xr | ||
import os, pytest | ||
import textract | ||
|
||
import importlib | ||
import nctoolkit as nc | ||
|
||
|
||
|
||
class TestFinal: | ||
def test_cheat(self): | ||
|
||
# only run this test on linux | ||
if os.name == "posix": | ||
assert len(nc.session_files()) == 0 | ||
assert len(nc.session.get_safe()) == 0 | ||
ff = "../cheatsheet/nctoolkit_cheatsheet.pdf" | ||
assert len(nc.session_files()) == 0 | ||
assert len(nc.session.get_safe()) == 0 | ||
ff = "cheatsheet/nctoolkit_cheatsheet.pdf" | ||
# read p df ff | ||
text = textract.process(ff, method='pdfminer') | ||
text = text.decode('utf-8') | ||
# version format is v*.*.*. Find it in text | ||
import re | ||
pattern = re.compile(r'v\d+\.\d+\.\d+') | ||
version = pattern.search(text) | ||
version = version.group() | ||
version = version.replace("v", "") | ||
the_version = nc.__version__ | ||
assert version == the_version | ||
|
||
|