示例#1
0
 def test_scalar_in_excluded(self):
   asserts.assert_scalar_in(0.5, 0, 1, included=False)
   with self.assertRaisesRegex(AssertionError, 'argument must be in'):
     asserts.assert_scalar_in(0, 0, 1, included=False)
   with self.assertRaisesRegex(AssertionError, 'argument must be in'):
     asserts.assert_scalar_in(1, 0, 1, included=False)
示例#2
0
 def test_scalar_in(self):
   asserts.assert_scalar_in(0.5, 0, 1)
   with self.assertRaisesRegex(AssertionError, 'argument must be in'):
     asserts.assert_scalar_in(-0.5, 0, 1)
   with self.assertRaisesRegex(AssertionError, 'argument must be in'):
     asserts.assert_scalar_in(1.5, 0, 1)