Did I find the right examples for you? yes no

All Samples(77)  |  Call(36)  |  Derive(0)  |  Import(41)
Checks whether something is contained in another thing.

src/n/o/nova-HEAD/nova/tests/virt/baremetal/test_pxe.py   nova(Download)
        end = config.index('label boot')
        self.assertThat(config[start:end], matchers.MatchesAll(
            matchers.Contains('kernel ddd'),
            matchers.Contains('initrd=eee'),
            matchers.Contains('deployment_id=aaa'),
            matchers.Contains('deployment_key=bbb'),
            matchers.Contains('iscsi_target_iqn=ccc'),

src/t/e/testtools-0.9.35/testtools/testcase.py   testtools(Download)
    reraise,
    )
from testtools.matchers import (
    Annotate,
    Contains,
    def assertIn(self, needle, haystack):
        """Assert that needle is in haystack."""
        self.assertThat(haystack, Contains(needle))
 
    def assertIsNone(self, observed, message=''):
    def assertNotIn(self, needle, haystack):
        """Assert that needle is not in haystack."""
        matcher = Not(Contains(needle))
        self.assertThat(haystack, matcher)
 

src/t/e/testtools-HEAD/testtools/testcase.py   testtools(Download)
    reraise,
    )
from testtools.matchers import (
    Annotate,
    Contains,
    def assertIn(self, needle, haystack, message=''):
        """Assert that needle is in haystack."""
        self.assertThat(haystack, Contains(needle), message)
 
    def assertIsNone(self, observed, message=''):
    def assertNotIn(self, needle, haystack, message=''):
        """Assert that needle is not in haystack."""
        matcher = Not(Contains(needle))
        self.assertThat(haystack, matcher, message)
 

src/t/e/testtools-0.9.35/testtools/tests/test_testresult.py   testtools(Download)
    )
from testtools.content_type import ContentType, UTF8_TEXT
from testtools.matchers import (
    AllMatch,
    Contains,
    def _local_os_error_matcher(self):
        if sys.version_info > (3, 3):
            return MatchesAny(Contains("FileExistsError: "),
                              Contains("PermissionError: "))
        elif os.name != "nt":
            return Contains(self._as_output("OSError: "))
        else:
            return Contains(self._as_output("WindowsError: "))

src/t/e/testtools-HEAD/testtools/tests/test_testresult.py   testtools(Download)
    )
from testtools.content_type import ContentType, UTF8_TEXT
from testtools.matchers import (
    AllMatch,
    Contains,
    def _local_os_error_matcher(self):
        if sys.version_info > (3, 3):
            return MatchesAny(Contains("FileExistsError: "),
                              Contains("PermissionError: "))
        elif os.name != "nt":
            return Contains(self._as_output("OSError: "))
        else:
            return Contains(self._as_output("WindowsError: "))

src/t/e/testtools-0.9.35/testtools/tests/matchers/test_filesystem.py   testtools(Download)
 
from testtools import TestCase
from testtools.matchers import (
    Contains,
    DocTestMatches,
    def test_matcher(self):
        tempdir = self.mkdtemp()
        self.touch(os.path.join(tempdir, 'foo'))
        self.touch(os.path.join(tempdir, 'bar'))
        self.assertThat(tempdir, DirContains(matcher=Contains('bar')))
    def test_both_specified(self):
        self.assertRaises(
            AssertionError, DirContains, filenames=[], matcher=Contains('a'))
 
    def test_does_not_contain_files(self):
    def test_both_specified(self):
        self.assertRaises(
            AssertionError, FileContains, contents=[], matcher=Contains('a'))
 
    def test_does_not_contain(self):

src/t/e/testtools-HEAD/testtools/tests/matchers/test_filesystem.py   testtools(Download)
 
from testtools import TestCase
from testtools.matchers import (
    Contains,
    DocTestMatches,
    def test_matcher(self):
        tempdir = self.mkdtemp()
        self.touch(os.path.join(tempdir, 'foo'))
        self.touch(os.path.join(tempdir, 'bar'))
        self.assertThat(tempdir, DirContains(matcher=Contains('bar')))
    def test_both_specified(self):
        self.assertRaises(
            AssertionError, DirContains, filenames=[], matcher=Contains('a'))
 
    def test_does_not_contain_files(self):
    def test_both_specified(self):
        self.assertRaises(
            AssertionError, FileContains, contents=[], matcher=Contains('a'))
 
    def test_does_not_contain(self):

src/o/t/otter-HEAD/otter/test/test_log.py   otter(Download)
from twisted.trial.unittest import SynchronousTestCase
 
from testtools.matchers import Contains, ContainsDict, Equals
 
from otter.log import audit
        self.observer.assert_called_once_with({
            'message': '{u"Hello": "There"}',
            'message_formatting_error': matches(Contains('KeyError'))
        })
 
 
        self.observer.assert_called_once_with(
            matches(ContainsDict({'traceback': Contains('Traceback')})))
 
    def test_failure_repr_in_short_message(self):
            matches(
                ContainsDict(
                    {'message': Contains('Everything is terrible.')})))
 
    def test_includes_structured_data(self):

src/t/e/testkraut-HEAD/testkraut/testcase.py   testkraut(Download)
from testtools.content_type import ContentType, UTF8_TEXT
from testtools import matchers as tm
from testtools.matchers import Equals, Annotate, FileExists, Contains, DirExists
import testtools.matchers as tt_matchers
from . import matchers as tk_matchers

src/t/e/testtools-HEAD/testtools/tests/test_run.py   testtools(Download)
    StringIO,
    )
from testtools.matchers import Contains
 
 

  1 | 2 | 3 | 4 | 5  Next