Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def test_str2bool(self):
"""Test return code from utils.str2bool."""
self.assertTrue(str2bool('y'))
self.assertTrue(str2bool('Y'))
self.assertTrue(str2bool('yes'))
self.assertTrue(str2bool(1))
self.assertFalse(str2bool('n'))
self.assertFalse(str2bool('N'))
self.assertFalse(str2bool('no'))
self.assertFalse(str2bool(0))
self.assertTrue(str2bool(u'Y'))
self.assertRaises(ValueError, str2bool, 'amcrest')
def is_record_on_motion_detection(self):
ret = self.motion_detection
status = [s for s in ret.split() if '.RecordEnable=' in s][0]\
.split('=')[-1]
return str2bool(status) # pylint: disable=no-value-for-parameter
def is_motion_detector_on(self):
ret = self.motion_detection
status = [s for s in ret.split() if '.Enable=' in s][0]\
.split('=')[-1]
return str2bool(status) # pylint: disable=no-value-for-parameter