zenoss / ZenPacks.zenoss.ZenPackLib

This is a helper library for zenpacks.
http://zenpacklib.zenoss.com/
GNU General Public License v2.0
15 stars 17 forks source link

Fix test_integer_threshold unit test error #438

Closed cluther closed 7 years ago

cluther commented 7 years ago

This error would occur when running ZenPackLib unit tests when DurationThreshold was installed. It wouldn't occur if DurationThreshold was not installed.

Error in test test_integer_threshold (ZenPacks.zenoss.ZenPackLib.tests.test_violation_percent_integer.TestDurationThresholdInteger)
Traceback (most recent call last):
  File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
    testMethod()
  File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.ZenPackLib-2.0.4-py2.7.egg/ZenPacks/zenoss/ZenPackLib/tests/test_violation_percent_integer.py", line 56, in test_integer_threshold
    t = tcs.create(self.dmd, False)
  File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.ZenPackLib-2.0.4-py2.7.egg/ZenPacks/zenoss/ZenPackLib/lib/spec/RRDTemplateSpec.py", line 150, in create
    threshold_spec.create(self, template)
  File "/opt/zenoss/ZenPacks/ZenPacks.zenoss.ZenPackLib-2.0.4-py2.7.egg/ZenPacks/zenoss/ZenPackLib/lib/spec/RRDThresholdSpec.py", line 79, in create
    (self.type_, ', '.join(threshold_types)))
ValueError: 'DurationThreshold' is an invalid threshold type. Valid types: MinMaxThreshold, ValueChangeThreshold

  Ran 1 tests with 0 failures and 1 errors in 1.166 seconds.
Tearing down left over layers:
  Tear down Products.ZenTestCase.BaseTestCase.ZenossTestCaseLayer in 0.000 seconds.
  Tear down Testing.ZopeTestCase.layer.ZopeLite in 0.000 seconds.

Tests with errors:
   test_integer_threshold (ZenPacks.zenoss.ZenPackLib.tests.test_violation_percent_integer.TestDurationThresholdInteger)