Did I find the right examples for you? yes no

All Samples(154)  |  Call(154)  |  Derive(0)  |  Import(0)
Assert that 'expected' is equal to 'observed'.

:param expected: The expected value.
:param observed: The observed value.
:param message: An optional message to include in the error.

src/t/e/testtools-0.9.35/testtools/tests/test_monkey.py   testtools(Download)
        # We can't assert that all state is unchanged, but at least we can
        # check our test object.
        self.assertEquals(self.original_object.foo, self.test_object.foo)
        self.assertEquals(self.original_object.bar, self.test_object.bar)
        self.assertEquals(self.original_object.baz, self.test_object.baz)
                                (self.test_object, 'bar', 'hehe'))
        patcher.patch()
        self.assertEquals('haha', self.test_object.foo)
        self.assertEquals('hehe', self.test_object.bar)
        self.assertEquals(self.original_object.baz, self.test_object.baz)

src/t/e/testtools-HEAD/testtools/tests/test_monkey.py   testtools(Download)
        # We can't assert that all state is unchanged, but at least we can
        # check our test object.
        self.assertEquals(self.original_object.foo, self.test_object.foo)
        self.assertEquals(self.original_object.bar, self.test_object.bar)
        self.assertEquals(self.original_object.baz, self.test_object.baz)
                                (self.test_object, 'bar', 'hehe'))
        patcher.patch()
        self.assertEquals('haha', self.test_object.foo)
        self.assertEquals('hehe', self.test_object.bar)
        self.assertEquals(self.original_object.baz, self.test_object.baz)

src/t/e/testtools-0.9.35/testtools/tests/test_compat.py   testtools(Download)
    def test_nonexistant_file_as_ascii(self):
        """When file can't be found, the encoding should default to ascii"""
        self.assertEquals("ascii", _get_source_encoding(self.filename))
 
    def test_encoding_is_cached(self):
        """The encoding should stay the same if the cache isn't invalidated"""
        self.put_source(
            "# coding: iso-8859-13\n"
            "import os\n")
        self.assertEquals("iso-8859-13", _get_source_encoding(self.filename))
            "# coding: rot-13\n"
            "vzcbeg bf\n")
        self.assertEquals("iso-8859-13", _get_source_encoding(self.filename))
 
    def test_traceback_rechecks_encoding(self):
        """A traceback function checks the cache and resets the encoding"""
        self.put_source(
            "# coding: iso-8859-8\n"
            "import os\n")
        self.assertEquals("iso-8859-8", _get_source_encoding(self.filename))
        else:
            self.fail("RuntimeError not raised")
        self.assertEquals("utf-8", _get_source_encoding(self.filename))
 
 

src/t/e/testtools-HEAD/testtools/tests/test_compat.py   testtools(Download)
    def test_nonexistant_file_as_ascii(self):
        """When file can't be found, the encoding should default to ascii"""
        self.assertEquals("ascii", _get_source_encoding(self.filename))
 
    def test_encoding_is_cached(self):
        """The encoding should stay the same if the cache isn't invalidated"""
        self.put_source(
            "# coding: iso-8859-13\n"
            "import os\n")
        self.assertEquals("iso-8859-13", _get_source_encoding(self.filename))
            "# coding: rot-13\n"
            "vzcbeg bf\n")
        self.assertEquals("iso-8859-13", _get_source_encoding(self.filename))
 
    def test_traceback_rechecks_encoding(self):
        """A traceback function checks the cache and resets the encoding"""
        self.put_source(
            "# coding: iso-8859-8\n"
            "import os\n")
        self.assertEquals("iso-8859-8", _get_source_encoding(self.filename))
        else:
            self.fail("RuntimeError not raised")
        self.assertEquals("utf-8", _get_source_encoding(self.filename))
 
 

src/s/s/sst-0.2.4/src/sst/tests/test_command.py   sst(Download)
    def test_single_regexp(self):
        opts, args = self.parse_args(['foo'])
        self.assertEquals(['foo'], args)
        self.assertIs(None, opts.excludes)
 
    def test_multiple_regexps(self):
        opts, args = self.parse_args(
            ['foo', 'bar', 'baz'])
        self.assertEquals(['foo', 'bar', 'baz'], args)
    def test_single_exclude(self):
        opts, args = self.parse_args(['--exclude', 'foo'])
        self.assertEquals(['foo'], opts.excludes)
        self.assertEqual([], args)
 
    def test_multiple_excludes(self):
        opts, args = self.parse_args(
            ['--exclude', 'foo', '-e', 'bar', '-ebaz'])
        self.assertEquals(['foo', 'bar', 'baz'], opts.excludes)
        clean.add('interrupts', kb_interrupts)
        self.assertRaises(KeyboardInterrupt, clean.cleanup_now)
        self.assertEquals('interrupts', out.getvalue())
        # The cleanups are still in place
        self.assertEqual([('interrupts', kb_interrupts, (), {}),

src/s/o/soupmatchers-0.2/soupmatchers/tests/test_matchers.py   soupmatchers(Download)
    def test_response_has_status_code_matches_200(self):
        response = TestResponse(status_code=200)
        match = matchers.ResponseHas(status_code=200).match(response)
        self.assertEquals(None, match)
        # Check the default value
        match = matchers.ResponseHas().match(response)
        self.assertEquals(None, match)
    def test_response_has_status_code_matches_404(self):
        response = TestResponse(status_code=404)
        match = matchers.ResponseHas(status_code=404).match(response)
        self.assertEquals(None, match)
 
    def test_response_has_wrong_status_code(self):
        response = TestResponse(status_code=404)
        match = matchers.ResponseHas(status_code=200).match(response)
        self.assertEquals(matchers.StatusCodeMismatch(200, 404), match)
        match = matchers.ResponseHas(status_code=200).match(response)
        self.assertEquals(
            {"html": Content(ContentType("text", "html"), lambda: content)},
            match.get_details())
 

src/o/o/oops_dictconfig-0.0.5/oops_dictconfig/tests/test_dictconfig.py   oops_dictconfig(Download)
                inherit_id=inherit_id)
        config = self.get_config_from_dict([publisher_defn])
        self.assertEquals(inherit_id, config.publishers[0].im_self.inherit_id)
 
    def test_datedir_sets_stash_path_on_repo(self):
        stash_path = True
        publisher_defn = dict(type='datedir', error_dir=self.getUniqueString(),
                stash_path=stash_path)
        config = self.get_config_from_dict([publisher_defn])
        self.assertEquals(stash_path, config.publishers[0].im_self.stash_path)
        #   oops.publish_new_only. Find a better way of testing that the
        #   publish method was wrapped by oops.publish_new_only
        self.assertEquals('result', config.publishers[0].func_name)
 
    def test_datedir_doesnt_wrap_if_new_only_is_False(self):
        #   oops.publish_new_only. Find a better way of testing that the
        #   publish method was not wrapped by oops.publish_new_only
        self.assertEquals('publish', config.publishers[0].func_name)
 
    def test_amqp_missing_exchange_name_gives_error(self):
        #   oops.publish_new_only. Find a better way of testing that the
        #   publish method was wrapped by oops.publish_new_only
        self.assertEquals('result', config.publishers[0].func_name)
 
    def test_amqp_doesnt_wrap_if_new_only_is_False(self):

src/t/e/testscenarios-0.4/lib/testscenarios/tests/test_scenarios.py   testscenarios(Download)
        result_tests = list(testtools.iterate_tests(suite))
        self.assertEquals(
            2,
            len(result_tests),
            result_tests)
        result_tests = list(testtools.iterate_tests(suite))
        self.assertEquals(
            2,
            len(result_tests),
            result_tests)

src/p/y/python-subunit-0.0.18/python/subunit/tests/test_test_results.py   python-subunit(Download)
        tag_collapser.startTest(self)
        self.assertEquals(
            [('tags', set(['a', 'b']), set([])),
             ('startTest', self),
             ], result._events)
        tag_collapser.stopTestRun()
        self.assertEquals(
            [('startTestRun',),
             ('tags', set(['a', 'b']), set([])),
             ('startTest', self),
        tag_collapser.stopTest(test)
        self.assertEquals(
            [('startTest', test),
             ('tags', set(['b', 'c']), set(['a'])),
             ('stopTest', test)],
        tag_collapser.stopTest(test)
        self.assertEquals(
            [('startTest', test),
             ('tags', set(['a', 'b', 'c']), set()),
             ('stopTest', test)],
        tag_collapser.stopTest(test)
        self.assertEquals(
            [('startTest', test),
             ('tags', set(['a']), set()),
             ('addSuccess', test),

src/s/s/sst-0.2.4/src/sst/tests/test_xvfb.py   sst(Download)
        self.assertNotEqual(orig, os.environ['DISPLAY'])
        xvfb.stop()
        self.assertEquals(orig, os.environ['DISPLAY'])
 
 

  1 | 2 | 3  Next