def test_contains(self): # Case-insensitive self.assertTrue('oo' in ttypes.SmartCmpStr('foo')) self.assertTrue('oo' in ttypes.SmartCmpStr('FOO')) # Case-sensitive self.assertFalse('OO' in ttypes.SmartCmpStr('foo')) self.assertTrue('OO' in ttypes.SmartCmpStr('FOO'))
def test_ge(self): self.assertTrue(ttypes.SmartCmpStr('foo') >= '3') self.assertTrue(ttypes.SmartCmpStr('foo') >= '2') self.assertTrue(ttypes.SmartCmpStr('zoo') >= 'zoo') self.assertTrue(ttypes.SmartCmpStr('zoo') >= 'abc') self.assertFalse(ttypes.SmartCmpStr('foo') >= '4') self.assertFalse(ttypes.SmartCmpStr('foo') >= 'zoo')
def test_le(self): self.assertTrue(ttypes.SmartCmpStr('foo') <= '3') self.assertTrue(ttypes.SmartCmpStr('foo') <= '4') self.assertTrue(ttypes.SmartCmpStr('abc') <= 'def') self.assertTrue(ttypes.SmartCmpStr('abc') <= 'zoo') self.assertFalse(ttypes.SmartCmpStr('foo') <= '2') self.assertFalse(ttypes.SmartCmpStr('zoo') <= 'aaa')
def test_contains(self): self.assertTrue('foo' in ttypes.SmartCmpStr('foo')) self.assertTrue('foo' in ttypes.SmartCmpStr('Foo')) self.assertFalse('Foo' in ttypes.SmartCmpStr('foo'))
def test_ge(self): self.assertTrue(ttypes.SmartCmpStr('foo') >= 'foo') self.assertTrue(ttypes.SmartCmpStr('Foo') >= 'foo') self.assertTrue(ttypes.SmartCmpStr('foo') >= 'Foo')
def test_gt(self): self.assertFalse(ttypes.SmartCmpStr('foo') > 'foo') self.assertFalse(ttypes.SmartCmpStr('Foo') > 'foo') self.assertTrue(ttypes.SmartCmpStr('foo') > 'Foo')
def test_le(self): self.assertTrue(ttypes.SmartCmpStr('foo') <= 'foo') self.assertTrue(ttypes.SmartCmpStr('Foo') <= 'foo') self.assertFalse(ttypes.SmartCmpStr('foo') <= 'Foo')
def test_lt(self): self.assertFalse(ttypes.SmartCmpStr('foo') < 'foo') self.assertFalse(ttypes.SmartCmpStr('Foo') < 'foo') self.assertFalse(ttypes.SmartCmpStr('foo') < 'Foo')
def test_eq_ne(self): self.assertTrue(ttypes.SmartCmpStr('foo') == 'foo') self.assertTrue(ttypes.SmartCmpStr('Foo') == 'foo') self.assertTrue(ttypes.SmartCmpStr('foo') != 'Foo')
def test_gt(self): self.assertTrue(ttypes.SmartCmpStr('foo') > '2') self.assertTrue(ttypes.SmartCmpStr('bbb') > 'aaa') self.assertFalse(ttypes.SmartCmpStr('foo') > '3') self.assertFalse(ttypes.SmartCmpStr('abc') > 'def')
def test_lt(self): self.assertTrue(ttypes.SmartCmpStr('foo') < '4') self.assertTrue(ttypes.SmartCmpStr('aaa') < 'bbb') self.assertFalse(ttypes.SmartCmpStr('foo') < '3') self.assertFalse(ttypes.SmartCmpStr('def') < 'abc')