Did I find the right examples for you? yes no

All Samples(7105)  |  Call(7105)  |  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/s/t/stackalytics-HEAD/tests/unit/test_record_processor.py   stackalytics(Download)
        email = 'jdoe@ibm.com'
        res = record_processor_inst._get_company_by_email(email)
        self.assertEqual('IBM', res)
 
    def test_get_company_by_email_with_long_suffix_mapped(self):
        email = 'man@mxw.nes.nec.co.jp'
        res = record_processor_inst._get_company_by_email(email)
        self.assertEqual('NEC', res)
 
    def test_get_company_by_email_with_long_suffix_mapped_2(self):
        email = 'man@mxw.nes.nec.com'
        res = record_processor_inst._get_company_by_email(email)
        self.assertEqual('NEC', res)
 
    def test_get_company_by_email_not_mapped(self):
        record_processor_inst = self.make_record_processor()
        email = 'foo@boo.com'
        res = record_processor_inst._get_company_by_email(email)
        self.assertEqual(None, res)
    def test_get_lp_info_invalid_email(self):
        self.read_launchpad.return_value = None
        record_processor_inst = self.make_record_processor(users=[])
        self.assertEqual((None, None),
                         record_processor_inst._get_lp_info('error.root'))

src/t/e/testtools-0.9.35/testtools/tests/test_testcase.py   testtools(Download)
    def test_id_comes_from_constructor(self):
        # The id() of a PlaceHolder is whatever you pass into the constructor.
        test = PlaceHolder("test id")
        self.assertEqual("test id", test.id())
 
    def test_shortDescription_is_id(self):
        # The shortDescription() of a PlaceHolder is the id, by default.
        test = PlaceHolder("test id")
        self.assertEqual(test.id(), test.shortDescription())
    def test_shortDescription_specified(self):
        # If a shortDescription is provided to the constructor, then
        # shortDescription() returns that instead.
        test = PlaceHolder("test id", "description")
        self.assertEqual("description", test.shortDescription())
    def test_repr_just_id(self):
        # repr(placeholder) shows you how the object was constructed.
        test = PlaceHolder("test id")
        self.assertEqual(
            "<testtools.testcase.PlaceHolder('addSuccess', %s, {})>" % repr(
    def test_repr_with_description(self):
        # repr(placeholder) shows you how the object was constructed.
        test = PlaceHolder("test id", "description")
        self.assertEqual(
            "<testtools.testcase.PlaceHolder('addSuccess', %r, {}, %r)>" % (

src/t/e/testtools-HEAD/testtools/tests/test_testcase.py   testtools(Download)
    def test_id_comes_from_constructor(self):
        # The id() of a PlaceHolder is whatever you pass into the constructor.
        test = PlaceHolder("test id")
        self.assertEqual("test id", test.id())
 
    def test_shortDescription_is_id(self):
        # The shortDescription() of a PlaceHolder is the id, by default.
        test = PlaceHolder("test id")
        self.assertEqual(test.id(), test.shortDescription())
    def test_shortDescription_specified(self):
        # If a shortDescription is provided to the constructor, then
        # shortDescription() returns that instead.
        test = PlaceHolder("test id", "description")
        self.assertEqual("description", test.shortDescription())
    def test_repr_just_id(self):
        # repr(placeholder) shows you how the object was constructed.
        test = PlaceHolder("test id")
        self.assertEqual(
            "<testtools.testcase.PlaceHolder('addSuccess', %s, {})>" % repr(
    def test_repr_with_description(self):
        # repr(placeholder) shows you how the object was constructed.
        test = PlaceHolder("test id", "description")
        self.assertEqual(
            "<testtools.testcase.PlaceHolder('addSuccess', %r, {}, %r)>" % (

src/s/t/stackalytics-HEAD/tests/unit/test_default_data_processor.py   stackalytics(Download)
 
        self.assertIn('releases', data['repos'][0])
        self.assertEqual([], data['repos'][0]['releases'],
                         message='Empty list of releases expected')
        self.assertEqual(0, data['users'][0]['companies'][-1]['end_date'],
                         message='The last company end date should be 0')
        self.assertIn('user_id', data['users'][0])
        self.assertEqual(test_data.USERS[0]['launchpad_id'],
            default_data_processor._update_project_list(dd)
 
            self.assertEqual(3, len(dd['repos']))
            self.assertIn('qa', set([r['module'] for r in dd['repos']]))
            self.assertIn('nova', set([r['module'] for r in dd['repos']]))
            self.assertIn('tux', set([r['module'] for r in dd['repos']]))
 
            self.assertEqual(2, len(dd['module_groups']))

src/z/u/zuul-HEAD/tests/test_scheduler.py   zuul(Download)
    def assertFinalState(self):
        # Make sure that the change cache is cleared
        self.assertEqual(len(self.gerrit._change_cache.keys()), 0)
        # Make sure that git.Repo objects have been garbage collected.
        repos = []
        gc.collect()
        for obj in gc.get_objects():
            if isinstance(obj, git.Repo):
                repos.append(obj)
        self.assertEqual(len(repos), 0)
                    print 'pipeline %s queue %s contents %s' % (
                        pipeline.name, queue.name, queue.queue)
                self.assertEqual(len(queue.queue), 0)
 
    def assertReportedStat(self, key, value=None, kind=None):
        self.fake_gerrit.addEvent(A.addApproval('APRV', 1))
        self.waitUntilSettled()
        self.assertEqual(self.getJobFromHistory('project-merge').result,
                         'SUCCESS')
        self.assertEqual(self.getJobFromHistory('project-test1').result,

src/t/r/trove-HEAD/trove/tests/unittests/taskmanager/test_models.py   trove(Download)
        server = self.freshinstancetasks._create_server(
            None, None, None, datastore_manager, None, None, None)
        self.assertEqual(server.userdata, self.userdata)
 
    @patch('trove.taskmanager.models.CONF')
        # verify
        self.assertTrue('/etc/trove-guestagent.conf' in server.files)
        self.assertEqual(server.files['/etc/trove-guestagent.conf'],
                         self.guestconfig_content)
 
            return_value=fake_DBInstance.find_by())
        self.freshinstancetasks.update_statuses_on_time_out()
        self.assertEqual(fake_InstanceServiceStatus.find_by().get_status(),
                         ServiceStatuses.FAILED_TIMEOUT_GUESTAGENT)
        self.assertEqual(fake_DBInstance.find_by().get_task_status(),
            Mock())
        self.freshinstancetasks._create_secgroup(datastore_manager)
        self.assertEqual(2, taskmanager_models.SecurityGroupRule.
                         create_sec_group_rule.call_count)
 

src/z/u/zuul-2.0.0/tests/test_scheduler.py   zuul(Download)
    def assertFinalState(self):
        # Make sure that the change cache is cleared
        self.assertEqual(len(self.gerrit._change_cache.keys()), 0)
        # Make sure that git.Repo objects have been garbage collected.
        repos = []
        gc.collect()
        for obj in gc.get_objects():
            if isinstance(obj, git.Repo):
                repos.append(obj)
        self.assertEqual(len(repos), 0)
                    print 'pipeline %s queue %s contents %s' % (
                        pipeline.name, queue.name, queue.queue)
                self.assertEqual(len(queue.queue), 0)
 
    def assertReportedStat(self, key, value=None, kind=None):
        self.fake_gerrit.addEvent(A.addApproval('APRV', 1))
        self.waitUntilSettled()
        self.assertEqual(self.getJobFromHistory('project-merge').result,
                         'SUCCESS')
        self.assertEqual(self.getJobFromHistory('project-test1').result,

src/t/r/trove-HEAD/trove/tests/unittests/backup/test_storage.py   trove(Download)
        self.assertTrue(success, "The backup should have been successful.")
        self.assertIsNotNone(note, "A note should have been returned.")
        self.assertEqual('http://mockswift/v1/database_backups/123.gz.enc',
                         location,
                         "Incorrect swift location was returned.")
        self.assertIsNone(checksum,
                          "Swift checksum should be None for failed backup.")
        self.assertEqual('http://mockswift/v1/database_backups/'
                         'bad_segment_etag_123.gz.enc',
                         location,
        self.assertIsNone(checksum,
                          "Swift checksum should be None for failed backup.")
        self.assertEqual('http://mockswift/v1/database_backups/'
                         'bad_manifest_etag_123.gz.enc',
                         location,
    def test_explode_location(self):
        location = 'http://mockswift.com/v1/545433/backups/mybackup.tar'
        url, container, filename = self.swift._explodeLocation(location)
        self.assertEqual(url, 'http://mockswift.com/v1/545433')
        self.assertEqual(container, 'backups')

src/t/e/testtools-0.9.35/testtools/tests/test_testresult.py   testtools(Download)
        def mismatch(self):
            self.assertEqual(1, 2)
    return Test("mismatch")
 
 
    def test_startTestRun(self):
        result = LoggingStreamResult()
        result.startTestRun()
        self.assertEqual([('startTestRun',)], result._events)
 
    def test_stopTestRun(self):
        result = LoggingStreamResult()
        result.startTestRun()
        result.stopTestRun()
        self.assertEqual([('startTestRun',), ('stopTestRun',)], result._events)
            test_id="id", route_code='abc', timestamp=now)
        self.assertEqual(
            [('startTestRun',),
             ('status', 'id', None, None, True, 'foo', 'bar', True, 'text/json', 'abc', now)],
            result._events)
            runnable=False, route_code='abc', timestamp=now)
        self.assertEqual(
            [('startTestRun',),
             ('status', 'foo', 'success', set(['tag']), False, None, None, False, None, 'abc', now)],
            result._events)

src/t/e/testtools-HEAD/testtools/tests/test_testresult.py   testtools(Download)
        def mismatch(self):
            self.assertEqual(1, 2)
    return Test("mismatch")
 
 
    def test_startTestRun(self):
        result = LoggingStreamResult()
        result.startTestRun()
        self.assertEqual([('startTestRun',)], result._events)
 
    def test_stopTestRun(self):
        result = LoggingStreamResult()
        result.startTestRun()
        result.stopTestRun()
        self.assertEqual([('startTestRun',), ('stopTestRun',)], result._events)
            test_id="id", route_code='abc', timestamp=now)
        self.assertEqual(
            [('startTestRun',),
             ('status', 'id', None, None, True, 'foo', 'bar', True, 'text/json', 'abc', now)],
            result._events)
            runnable=False, route_code='abc', timestamp=now)
        self.assertEqual(
            [('startTestRun',),
             ('status', 'foo', 'success', set(['tag']), False, None, None, False, None, 'abc', now)],
            result._events)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next