Python源码示例:syntaxnet.util.check.IsNot()

示例1
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例2
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例3
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例4
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例5
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例6
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例7
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例8
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError) 
示例9
def testCheckIsNot(self):
    check.IsNot(1, 2, 'foo')
    check.IsNot(1, None, 'foo')
    with self.assertRaisesRegexp(ValueError, 'bar'):
      check.IsNot(None, None, 'bar')
    with self.assertRaisesRegexp(RuntimeError, 'baz'):
      check.IsNot(1, 1, 'baz', RuntimeError)