Skip to content

Commit

Permalink
add test to make sure cheat sheet version is up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjwilson committed Feb 6, 2024
1 parent 4c84a5c commit cb807af
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-app-linux.yml
Expand Up @@ -43,6 +43,7 @@ jobs:
pip install pandas
pip install rioxarray
pip install pytest
pip install textract
pip install pytest-cov
pip install coverage
Expand Down
34 changes: 34 additions & 0 deletions tests/test_cheat.py
@@ -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


0 comments on commit cb807af

Please sign in to comment.