def test_get_packit_version(): flexmock(Distribution).should_receive("version").and_return("0.1.0") assert get_packit_version() == "0.1.0"
def test_get_packit_version_not_installed(): flexmock(sys.modules["packit.api"]).should_receive( "get_distribution").and_raise(DistributionNotFound) assert get_packit_version() == "NOT_INSTALLED"