def test_min_or_max_version(self): """ test if min_version and max_version are configured when version is not given """ version = VersionedDependency(name='tensorflow', min_version='0.1.0') self.assertTrue(version.min_version == '0.1.0') self.assertTrue(version.has_versions()) version = VersionedDependency(name='tensorflow', max_version='0.3.0') self.assertTrue(version.max_version == '0.3.0') self.assertTrue(version.has_versions())
def test_version(self): """ test version overrides min_version and max_version """ version = VersionedDependency(name='tensorflow', version='0.3.0', min_version='0.1.0', max_version='0.4.0') self.assertTrue(version.min_version == '0.3.0') self.assertTrue(version.max_version == '0.3.0') self.assertTrue(version.has_versions()) self.assertTrue(version.name == 'tensorflow')
def test_no_version(self): """ test the no version scenario """ version = VersionedDependency(name='tensorflow') self.assertFalse(version.has_min_version()) self.assertFalse(version.has_max_version()) self.assertFalse(version.has_versions())