def testDefaults(self):
assert not Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
assert Feature("test",standard=True,remove='x').include_by_default()
# Feature must have either kwargs, removes, or require_features
with pytest.raises(DistutilsSetupError):
Feature("test")
python类Feature()的实例源码
def testFeatureWithInvalidRemove(self):
with pytest.raises(SystemExit):
makeSetup(features={'x':Feature('x', remove='y')})
def testDefaults(self):
assert not Feature(
"test", standard=True, remove='x', available=False
).include_by_default()
assert Feature("test", standard=True, remove='x').include_by_default()
# Feature must have either kwargs, removes, or require_features
with pytest.raises(DistutilsSetupError):
Feature("test")
def testFeatureWithInvalidRemove(self):
with pytest.raises(SystemExit):
makeSetup(features={'x': Feature('x', remove='y')})
def testDefaults(self):
self.assertTrue(not
Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
)
self.assertTrue(
Feature("test",standard=True,remove='x').include_by_default()
)
# Feature must have either kwargs, removes, or require_features
self.assertRaises(DistutilsSetupError, Feature, "test")
def testFeatureWithInvalidRemove(self):
self.assertRaises(
SystemExit, makeSetup, features = {'x':Feature('x', remove='y')}
)
def testDefaults(self):
self.assertTrue(not
Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
)
self.assertTrue(
Feature("test",standard=True,remove='x').include_by_default()
)
# Feature must have either kwargs, removes, or require_features
self.assertRaises(DistutilsSetupError, Feature, "test")
def testFeatureWithInvalidRemove(self):
self.assertRaises(
SystemExit, makeSetup, features = {'x':Feature('x', remove='y')}
)
def testDefaults(self):
assert not Feature(
"test", standard=True, remove='x', available=False
).include_by_default()
assert Feature("test", standard=True, remove='x').include_by_default()
# Feature must have either kwargs, removes, or require_features
with pytest.raises(DistutilsSetupError):
Feature("test")
def testFeatureWithInvalidRemove(self):
with pytest.raises(SystemExit):
makeSetup(features={'x': Feature('x', remove='y')})
def testDefaults(self):
assert not Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
assert Feature("test",standard=True,remove='x').include_by_default()
# Feature must have either kwargs, removes, or require_features
with pytest.raises(DistutilsSetupError):
Feature("test")
def testFeatureWithInvalidRemove(self):
with pytest.raises(SystemExit):
makeSetup(features={'x':Feature('x', remove='y')})
def testDefaults(self):
assert not Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
assert Feature("test",standard=True,remove='x').include_by_default()
# Feature must have either kwargs, removes, or require_features
with pytest.raises(DistutilsSetupError):
Feature("test")
def testFeatureWithInvalidRemove(self):
with pytest.raises(SystemExit):
makeSetup(features={'x':Feature('x', remove='y')})
def testDefaults(self):
self.assertTrue(not
Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
)
self.assertTrue(
Feature("test",standard=True,remove='x').include_by_default()
)
# Feature must have either kwargs, removes, or require_features
self.assertRaises(DistutilsSetupError, Feature, "test")
def testFeatureWithInvalidRemove(self):
self.assertRaises(
SystemExit, makeSetup, features = {'x':Feature('x', remove='y')}
)
def testDefaults(self):
self.assertTrue(not
Feature(
"test",standard=True,remove='x',available=False
).include_by_default()
)
self.assertTrue(
Feature("test",standard=True,remove='x').include_by_default()
)
# Feature must have either kwargs, removes, or require_features
self.assertRaises(DistutilsSetupError, Feature, "test")
def testFeatureWithInvalidRemove(self):
self.assertRaises(
SystemExit, makeSetup, features = {'x':Feature('x', remove='y')}
)