def test_identify(): dirpath = drop_constants_py(constants_04_py) assert identify(dirpath) == "0.4" dirpath = drop_constants_py(constants_041_py) assert identify(dirpath) == "0.4.1" dirpath = drop_constants_py(constants_042_py) assert identify(dirpath) == "0.4.2" dirpath = drop_constants_py(constants_05_py) assert identify(dirpath) == "0.5" dirpath = drop_constants_py(constants_06_py) assert identify(dirpath) == "0.6" dirpath = drop_constants_py(constants_10_py) assert identify(dirpath) == "1.0" dirpath = drop_constants_py(constants_11_py) assert identify(dirpath) == "1.1" dirpath = drop_constants_py(constants_12_py) assert identify(dirpath) == "1.2" dirpath = drop_constants_py(constants_20rc1_py) assert identify(dirpath) == "2.0-rc1" dirpath = drop_constants_py(constants_20rc2_py) assert identify(dirpath) == "2.0-rc2" dirpath = drop_constants_py(constants_20dev_py) assert identify(dirpath) == "2.0-dev" dirpath = drop_constants_py("hello world") assert identify(dirpath) is None