PageRenderTime 480ms queryTime 249ms sortTime 12ms getByIdsTime 35ms findMatchingLines 87ms

100+ results results for '"import unittest" unittest.TestCase self.assert lang:Python' (480 ms)

Not the results you expected?
test_registrar.py https://gitlab.com/noc0lour/mailman | Python | 268 lines
                    
19
                    
20import unittest
                    
21
                    
21
                    
22from mailman.app.lifecycle import create_list
                    
23from mailman.interfaces.mailinglist import SubscriptionPolicy
                    
23from mailman.interfaces.mailinglist import SubscriptionPolicy
                    
24from mailman.interfaces.member import MemberRole
                    
25from mailman.interfaces.pending import IPendings
                    
25from mailman.interfaces.pending import IPendings
                    
26from mailman.interfaces.registrar import IRegistrar
                    
27from mailman.interfaces.subscriptions import TokenOwner
                    
34
                    
35class TestRegistrar(unittest.TestCase):
                    
36    """Test registration."""
                    
                
layouttest_analyzer_helpers_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 212 lines
                    
10import time
                    
11import unittest
                    
12
                    
13
                    
14import layouttest_analyzer_helpers
                    
15
                    
16
                    
17class TestLayoutTestAnalyzerHelpers(unittest.TestCase):
                    
18
                    
84                      'media/track/track-webvtt-tc004-magicheader.html')
                    
85    self.assertEquals(diff['whole'][0][0][0],
                    
86                      'media/video-source-type.html')
                    
91    self.assertEquals(diff['whole'][1][0][0], 'add1.html')
                    
92    self.assertEquals(diff['skip'][1][0][0], 'add2.html')
                    
93
                    
                
test_languages.py https://gitlab.com/Smileyt/KomodoEdit | Python | 275 lines
                    
3
                    
4import unittest
                    
5
                    
5
                    
6from xpcom import components
                    
7from xpcom.server import UnwrapObject
                    
8
                    
9from testlib import tag
                    
10
                    
10
                    
11class koLanguageSvcTestCase(unittest.TestCase):
                    
12    """Base class for koIDocument test cases."""
                    
222            elif issubclass(vars, Exception):
                    
223                self.assertRaises(ValueError, self.langRegistrySvcUnwrapped._getEmacsLocalVariables,
                    
224                                  head, tail)
                    
                
test_events.py https://gitlab.com/goolic/pyramid | Python | 301 lines
                    
1import unittest
                    
2from pyramid import testing
                    
3
                    
4class NewRequestEventTests(unittest.TestCase):
                    
5    def _getTargetClass(self):
                    
29
                    
30class NewResponseEventTests(unittest.TestCase):
                    
31    def _getTargetClass(self):
                    
91
                    
92class ContextFoundEventTests(unittest.TestCase):
                    
93    def _getTargetClass(self):
                    
126
                    
127class TestSubscriber(unittest.TestCase):
                    
128    def setUp(self):
                    
202
                    
203class TestBeforeRender(unittest.TestCase):
                    
204    def _makeOne(self, system, val=None):
                    
                
test_steps_master.py https://gitlab.com/murder187ss/buildbot | Python | 239 lines
                    
20from twisted.internet import reactor
                    
21from twisted.python import failure
                    
22from twisted.python import runtime
                    
22from twisted.python import runtime
                    
23from twisted.trial import unittest
                    
24
                    
36
                    
37class TestMasterShellCommand(steps.BuildStepMixin, unittest.TestCase):
                    
38
                    
207
                    
208class TestSetProperty(steps.BuildStepMixin, unittest.TestCase):
                    
209
                    
224
                    
225class TestLogRenderable(steps.BuildStepMixin, unittest.TestCase):
                    
226
                    
                
test_threadsignals.py https://gitlab.com/unofficial-mirrors/cpython | Python | 227 lines
                    
2
                    
3import unittest
                    
4import signal
                    
6import sys
                    
7from test.support import run_unittest, import_module
                    
8thread = import_module('_thread')
                    
38
                    
39class ThreadSignals(unittest.TestCase):
                    
40
                    
64        self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped'], 1)
                    
65        self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped_by'],
                    
66                           thread.get_ident())
                    
77    # Issue #20564: sem_timedwait() cannot be interrupted on OpenBSD
                    
78    @unittest.skipIf(sys.platform.startswith('openbsd'),
                    
79                     'lock cannot be interrupted on OpenBSD')
                    
                
test_recipients.py https://gitlab.com/khushbuparakh/mailman | Python | 202 lines
                    
19
                    
20import unittest
                    
21
                    
27    configuration, specialized_message_from_string as mfs)
                    
28from mailman.testing.layers import ConfigLayer
                    
29from zope.component import getUtility
                    
31
                    
32class TestMemberRecipients(unittest.TestCase):
                    
33    """Test regular member recipient calculation."""
                    
82
                    
83class TestOwnerRecipients(unittest.TestCase):
                    
84    """Test owner recipient calculation."""
                    
118        self._process(self._mlist, self._msg, msgdata)
                    
119        self.assertEqual(msgdata['recipients'], set(('cris@example.com',
                    
120                                                     'dave@example.com')))
                    
                
test_profile.py https://gitlab.com/unofficial-mirrors/cpython | Python | 187 lines
                    
4import pstats
                    
5import unittest
                    
6import os
                    
6import os
                    
7from difflib import unified_diff
                    
8from io import StringIO
                    
8from io import StringIO
                    
9from test.support import TESTFN, run_unittest, unlink
                    
10from contextlib import contextmanager
                    
11
                    
12import profile
                    
13from test.profilee import testfunc, timer
                    
15
                    
16class ProfileTest(unittest.TestCase):
                    
17
                    
                
hid_gadget_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 258 lines
                    
5
                    
6import unittest
                    
7
                    
47
                    
48class HidGadgetTest(unittest.TestCase):
                    
49
                    
53                           vendor_id=0, product_id=0)
                    
54    with self.assertRaisesRegexp(ValueError, 'High speed'):
                    
55      hid_gadget.HidGadget(report_desc, features={}, interval_ms=5000,
                    
136
                    
137class HidFeatureTest(unittest.TestCase):
                    
138
                    
257if __name__ == '__main__':
                    
258  unittest.main()
                    
259
                    
                
httpclient_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 185 lines
                    
15
                    
16import unittest
                    
17
                    
21
                    
22class RealHttpFetchTest(unittest.TestCase):
                    
23
                    
58    name_value = real_http_fetch._GetHeaderNameValue(self.BAD_HEADER)
                    
59    self.assertIsNone(name_value)
                    
60
                    
118
                    
119class RealHttpFetchGetConnectionTest(unittest.TestCase):
                    
120  """Test that a connection is made with request IP/port or proxy IP/port."""
                    
145    self.assertEqual('127.127.127.127', connection.host)
                    
146    self.assertEqual(80, connection.port)  # default HTTP port
                    
147
                    
                
test_bus.py https://gitlab.com/gregtyka/frankenserver | Python | 263 lines
                    
2import time
                    
3import unittest
                    
4
                    
6from cherrypy._cpcompat import get_daemon, set
                    
7from cherrypy.process import wspbus
                    
8
                    
12
                    
13class PublishSubscribeTests(unittest.TestCase):
                    
14
                    
72
                    
73class BusMethodTests(unittest.TestCase):
                    
74
                    
123        # The stop method MUST call all 'stop' listeners.
                    
124        self.assertEqual(set(self.responses),
                    
125                         set([msg % (i, 'stop', None) for i in range(num)]))
                    
                
test_commands.py https://gitlab.com/smoke.torez/aws-cli | Python | 238 lines
                    
16import mock
                    
17import unittest
                    
18
                    
20
                    
21from awscli.customizations.datapipeline import convert_described_objects
                    
22from awscli.customizations.datapipeline import ListRunsCommand
                    
141
                    
142class TestConvertObjects(unittest.TestCase):
                    
143
                    
147        # This comes from a "refValue" value.
                    
148        self.assertEqual(converted[0]['@componentParent'], 'S3Input')
                    
149        # Should also merge in @id and name.
                    
152        # This comes from a "stringValue" value.
                    
153        self.assertEqual(converted[0]['@sphere'], "INSTANCE")
                    
154
                    
                
gpu_test_expectations_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 183 lines
                    
3# found in the LICENSE file.
                    
4import unittest
                    
5
                    
6from telemetry.internal.platform import system_info
                    
7from telemetry.page import page as page_module
                    
8from telemetry.story import story_set
                    
9
                    
10import gpu_test_expectations
                    
11
                    
71
                    
72class GpuTestExpectationsTest(unittest.TestCase):
                    
73  def setUp(self):
                    
123        StubPlatform('mac'), VENDOR_AMD, 0x1001)
                    
124    self.assertExpectationEquals('pass', page,
                    
125        StubPlatform('win'), VENDOR_AMD, 0x1002)
                    
                
test_extensions.py https://gitlab.com/unofficial-mirrors/cpython | Python | 298 lines
                    
1import sys
                    
2import unittest
                    
3import tkinter
                    
4from tkinter import ttk
                    
5from test.support import requires, run_unittest, swap_attr
                    
6from tkinter.test.support import AbstractTkTest, destroy_default_root
                    
9
                    
10class LabeledScaleTest(AbstractTkTest, unittest.TestCase):
                    
11
                    
137        lscale.scale.configure(from_=0, to=10)
                    
138        self.assertNotEqual(prev_xcoord, curr_xcoord)
                    
139        self.assertEqual(prev_xcoord, int(linfo_1['x']))
                    
206
                    
207class OptionMenuTest(AbstractTkTest, unittest.TestCase):
                    
208
                    
                
test_steps_shellsequence.py https://gitlab.com/murder187ss/buildbot | Python | 149 lines
                    
14# Copyright Buildbot Team Members
                    
15from twisted.trial import unittest
                    
16
                    
18from buildbot.process.results import EXCEPTION
                    
19from buildbot.process.results import FAILURE
                    
20from buildbot.process.results import SUCCESS
                    
21from buildbot.process.results import WARNINGS
                    
22from buildbot.steps import shellsequence
                    
23from buildbot.test.fake.remotecommand import Expect
                    
23from buildbot.test.fake.remotecommand import Expect
                    
24from buildbot.test.fake.remotecommand import ExpectShell
                    
25from buildbot.test.util import config as configmixin
                    
34
                    
35class TestOneShellCommand(steps.BuildStepMixin, unittest.TestCase, configmixin.ConfigErrorsMixin):
                    
36
                    
                
test_control.py https://gitlab.com/noc0lour/mailman | Python | 192 lines
                    
24import shutil
                    
25import signal
                    
26import socket
                    
26import socket
                    
27import unittest
                    
28
                    
32from mailman.config import Configuration, config
                    
33from mailman.testing.helpers import configuration
                    
34from mailman.testing.layers import ConfigLayer
                    
82
                    
83class TestStart(unittest.TestCase):
                    
84    """Test various starting scenarios."""
                    
144
                    
145class TestBinDir(unittest.TestCase):
                    
146    """Test issues related to bin_dir, e.g. issue #3"""
                    
                
test_ds.py https://gitlab.com/gregtyka/Scryve-Webapp | Python | 233 lines
                    
1import os, os.path, unittest
                    
2from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError
                    
2from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError
                    
3from django.contrib.gis.gdal.field import OFTReal, OFTInteger, OFTString
                    
4from django.contrib import gis
                    
40
                    
41class DataSourceTest(unittest.TestCase):
                    
42
                    
50            # Making sure the layer count is what's expected (only 1 layer in a SHP file)
                    
51            self.assertEqual(1, len(ds))
                    
52
                    
115                        for fld_name in fld_names:
                    
116                            self.assertEqual(source.field_values[fld_name][i], feat.get(fld_name))
                    
117        print "\nEND - expecting out of range feature id error; safe to ignore."
                    
131            control_vals = source.field_values[fld_name][sl]
                    
132            self.assertEqual(control_vals, test_vals)
                    
133
                    
                
test_init.py https://gitlab.com/mkerfoot/home-assistant | Python | 245 lines
                    
8import unittest
                    
9from unittest.mock import patch
                    
10from datetime import datetime, timedelta
                    
10from datetime import datetime, timedelta
                    
11import os
                    
12
                    
13from homeassistant.config import load_yaml_config_file
                    
14from homeassistant.loader import get_component
                    
15import homeassistant.util.dt as dt_util
                    
24
                    
25class TestComponentsDeviceTracker(unittest.TestCase):
                    
26    """ Tests homeassistant.components.device_tracker module. """
                    
112        self.assertEqual(device.dev_id, config.dev_id)
                    
113        self.assertEqual(device.track, config.track)
                    
114        self.assertEqual(device.mac, config.mac)
                    
                
test_unicode_file_functions.py https://gitlab.com/unofficial-mirrors/cpython | Python | 195 lines
                    
2# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
                    
3import os
                    
4import sys
                    
4import sys
                    
5import unittest
                    
6import warnings
                    
6import warnings
                    
7from unicodedata import normalize
                    
8from test import support
                    
54    except UnicodeEncodeError:
                    
55        raise unittest.SkipTest("only NT+ and systems with "
                    
56                                "Unicode-friendly filesystem encoding")
                    
58
                    
59class UnicodeFileTests(unittest.TestCase):
                    
60    files = set(filenames)
                    
                
test_pep3118.py https://gitlab.com/ZoZworc/install | Python | 203 lines
                    
1import unittest
                    
2from ctypes import *
                    
19
                    
20class Test(unittest.TestCase):
                    
21
                    
26            try:
                    
27                self.assertEqual(normalize(v.format), normalize(fmt))
                    
28                if shape is not None:
                    
28                if shape is not None:
                    
29                    self.assertEqual(len(v), shape[0])
                    
30                else:
                    
36                # they are always read/write
                    
37                self.assertFalse(v.readonly)
                    
38
                    
42                        n = n * dim
                    
43                    self.assertEqual(n * v.itemsize, len(v.tobytes()))
                    
44            except:
                    
                
test_turtle.py https://gitlab.com/unofficial-mirrors/cpython | Python | 436 lines
                    
1import pickle
                    
2import unittest
                    
3from test import support
                    
49
                    
50class TurtleConfigTest(unittest.TestCase):
                    
51
                    
130
                    
131class TestVec2D(VectorComparisonMixin, unittest.TestCase):
                    
132
                    
250
                    
251class TestTNavigator(VectorComparisonMixin, unittest.TestCase):
                    
252
                    
411
                    
412class TestTPen(unittest.TestCase):
                    
413
                    
                
test_zone.py https://gitlab.com/jonnialva90/iridium-browser | Python | 196 lines
                    
25import time
                    
26from tests.compat import unittest
                    
27from nose.plugins.attrib import attr
                    
33@attr(route53=True)
                    
34class TestRoute53Zone(unittest.TestCase):
                    
35    @classmethod
                    
66        self.assertEquals(record.name, u'www.%s.' % self.base_domain)
                    
67        self.assertEquals(record.resource_records, [
                    
68            u'webserver.%s.' % self.base_domain
                    
76        record = self.zone.get_cname('www.%s' % self.base_domain)
                    
77        self.assertEquals(record.name, u'www.%s.' % self.base_domain)
                    
78        self.assertEquals(record.resource_records, [
                    
168@attr(route53=True)
                    
169class TestRoute53PrivateZone(unittest.TestCase):
                    
170    @classmethod
                    
                
tests.py https://gitlab.com/asmjahid/django | Python | 325 lines
                    
1from __future__ import unicode_literals
                    
2
                    
2
                    
3import unittest
                    
4from datetime import datetime
                    
5
                    
6from django.core.paginator import (
                    
7    EmptyPage, InvalidPage, PageNotAnInteger, Paginator,
                    
8)
                    
9from django.test import TestCase
                    
10from django.utils import six
                    
11
                    
12from .custom import ValidAdjacentNumsPaginator
                    
13from .models import Article
                    
15
                    
16class PaginationTests(unittest.TestCase):
                    
17    """
                    
                
test_schedulers_triggerable.py https://gitlab.com/murder187ss/buildbot | Python | 333 lines
                    
21from twisted.python import log
                    
22from twisted.trial import unittest
                    
23
                    
27from buildbot.test.util import interfaces
                    
28from buildbot.test.util import scheduler
                    
29from buildbot.test.util.decorators import flaky
                    
31
                    
32class TriggerableInterfaceTest(unittest.TestCase, interfaces.InterfaceTests):
                    
33
                    
37
                    
38class Triggerable(scheduler.SchedulerMixin, unittest.TestCase):
                    
39
                    
156        sched = self.makeScheduler()
                    
157        self.assertEqual(sched.reason, "The Triggerable scheduler named 'n' triggered this build")
                    
158
                    
                
test_text.py https://gitlab.com/unofficial-mirrors/cpython | Python | 236 lines
                    
4'''
                    
5import unittest
                    
6from test.support import requires
                    
93        get = self.text.get
                    
94        Equal = self.assertEqual
                    
95        self.text.insert('1.0', self.hw)
                    
141        get = self.text.get
                    
142        Equal = self.assertEqual
                    
143        self.text.insert('1.0', self.hw)
                    
193
                    
194class MockTextTest(TextTest, unittest.TestCase):
                    
195
                    
216
                    
217class TkTextTest(TextTest, unittest.TestCase):
                    
218
                    
                
test_www_hooks_bitbucket.py https://gitlab.com/murder187ss/buildbot | Python | 267 lines
                    
18from twisted.internet.defer import inlineCallbacks
                    
19from twisted.trial import unittest
                    
20
                    
22
                    
23from buildbot.test.fake.web import FakeRequest
                    
24from buildbot.test.fake.web import fakeMasterForHooks
                    
137
                    
138class TestChangeHookConfiguredWithBitbucketChange(unittest.TestCase):
                    
139
                    
189
                    
190        self.assertEqual(len(self.change_hook.master.addedChanges), 0)
                    
191        self.assertEqual(request.written, 'no changes found')
                    
249            500, 'Error processing changes.')
                    
250        self.assertEqual(len(self.flushLoggedErrors()), 1)
                    
251
                    
                
test_data_changesources.py https://gitlab.com/murder187ss/buildbot | Python | 232 lines
                    
18from twisted.python import failure
                    
19from twisted.trial import unittest
                    
20
                    
28
                    
29class ChangeSourceEndpoint(endpoint.EndpointMixin, unittest.TestCase):
                    
30
                    
67            self.validateData(changesource)
                    
68            self.assertEqual(changesource['master'], None),
                    
69        return d
                    
108
                    
109class ChangeSourcesEndpoint(endpoint.EndpointMixin, unittest.TestCase):
                    
110
                    
160
                    
161class ChangeSource(interfaces.InterfaceTests, unittest.TestCase):
                    
162
                    
                
project_spec.py http://mobilegtd.googlecode.com/svn/trunk/ | Python | 327 lines
                    
1import unittest
                    
2from mock import Mock
                    
2from mock import Mock
                    
3import model.project
                    
4
                    
4
                    
5from model.project import Project
                    
6from model import project
                    
6from model import project
                    
7from model import action
                    
8
                    
9
                    
10class ProjectClassBehaviour(unittest.TestCase):
                    
11    def setUp(self):
                    
19
                    
20class ProjectBehaviour(unittest.TestCase):
                    
21
                    
                
test_singleton.py http://ultra-finance.googlecode.com/svn/trunk/ | Python | 272 lines
                    
6'''
                    
7import unittest
                    
8import time
                    
10
                    
11class testSingleton(unittest.TestCase):
                    
12        def testReturnsSameObject(self):
                    
22            a2 = A.getInstance()
                    
23            self.assertEquals(id(a1), id(a2))
                    
24
                    
65
                    
66            self.assertRaises(SingletonException, B.getInstance)
                    
67
                    
105
                    
106            self.assertRaises(SingletonException, instantiatedAnIllegalClass)
                    
107
                    
                
test.py https://gitlab.com/CarlosRA97/py-leveldb | Python | 300 lines
                    
5
                    
6import sys, string, unittest, itertools
                    
7
                    
7
                    
8class TestLevelDB(unittest.TestCase):
                    
9	def setUp(self):
                    
9	def setUp(self):
                    
10		# import local leveldb
                    
11		import leveldb as _leveldb
                    
76		kv = list(db.RangeIter(key_from = None, key_to = None))
                    
77		self.assertEqual(kv, kv_)
                    
78
                    
79		kv = list(db.RangeIter(key_to = None))
                    
80		self.assertEqual(kv, kv_)
                    
81
                    
                
test_events_state.py https://github.com/rlotun/celery.git | Python | 289 lines
                    
1from time import time
                    
2import unittest2 as unittest
                    
3
                    
3
                    
4from itertools import count
                    
5
                    
80
                    
81class test_Worker(unittest.TestCase):
                    
82
                    
88
                    
89class test_Task(unittest.TestCase):
                    
90
                    
122
                    
123class test_State(unittest.TestCase):
                    
124
                    
                
test_phenotype.py git://github.com/biopython/biopython.git | Python | 319 lines
                    
10try:
                    
11    import numpy
                    
12
                    
13    del numpy
                    
14except ImportError:
                    
15    from Bio import MissingExternalDependencyError
                    
21import json
                    
22import unittest
                    
23
                    
23
                    
24from io import StringIO
                    
25
                    
45
                    
46class TestPhenoMicro(unittest.TestCase):
                    
47    """Tests for phenotype support."""
                    
                
downloads_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 179 lines
                    
8import os
                    
9import unittest
                    
10
                    
13import apitools.base.py as apitools_base
                    
14import storage
                    
15
                    
25
                    
26class DownloadsTest(unittest.TestCase):
                    
27    _DEFAULT_BUCKET = 'apitools'
                    
84        self.__buffer.seek(0)
                    
85        self.assertEqual(file_contents, self.__buffer.read())
                    
86
                    
93        self.__buffer.seek(0)
                    
94        self.assertEqual(file_contents[5:11], self.__buffer.read())
                    
95
                    
                
test_sqlalchemy.py https://gitlab.com/gregtyka/frankenserver | Python | 415 lines
                    
9
                    
10import unittest
                    
11
                    
17
                    
18    from pyamf.adapters import _sqlalchemy_orm as adapter
                    
19except ImportError:
                    
49
                    
50class BaseTestCase(unittest.TestCase):
                    
51    """
                    
255
                    
256        self.assertEqual(sorted(attrs.keys()), [
                    
257            'addresses',
                    
387        self.assertNotEquals(None, adapter.class_mapper(User))
                    
388        self.assertTrue(adapter.is_class_sa_mapped(User))
                    
389
                    
                
unittest_pyreverse_diadefs.py https://gitlab.com/holtscomm/gae-purchase-order-system | Python | 174 lines
                    
19
                    
20import unittest
                    
21import sys
                    
53
                    
54class DiaDefGeneratorTC(unittest.TestCase):
                    
55    def test_option_values(self):
                    
89
                    
90class DefaultDiadefGeneratorTC(unittest.TestCase):
                    
91    def test_known_values1(self):
                    
92        dd = DefaultDiadefGenerator(Linker(PROJECT), HANDLER).visit(PROJECT)
                    
93        self.assertEqual(len(dd), 2)
                    
94        keys = [d.TYPE for d in dd]
                    
148
                    
149class ClassDiadefGeneratorTC(unittest.TestCase):
                    
150    def test_known_values1(self):
                    
                
test_lmtp.py https://gitlab.com/noc0lour/mailman | Python | 206 lines
                    
21import smtplib
                    
22import unittest
                    
23
                    
31
                    
32class TestLMTP(unittest.TestCase):
                    
33    """Test various aspects of the LMTP server."""
                    
56        self.assertEqual(cm.exception.smtp_code, 550)
                    
57        self.assertEqual(cm.exception.smtp_error,
                    
58                         b'No Message-ID header provided')
                    
82        all_headers = items[0].msg.get_all('message-id-hash')
                    
83        self.assertEqual(len(all_headers), 1)
                    
84        self.assertEqual(items[0].msg['message-id-hash'],
                    
168
                    
169class TestBugs(unittest.TestCase):
                    
170    """Test some LMTP related bugs."""
                    
                
test_run.py https://gitlab.com/czm1129/pyspider | Python | 336 lines
                    
9
                    
10import os
                    
11import sys
                    
18import requests
                    
19import unittest2 as unittest
                    
20
                    
24
                    
25class TestRun(unittest.TestCase):
                    
26
                    
95            from pyspider.database.sqlite import resultdb
                    
96            self.assertIsInstance(ctx.obj.resultdb, resultdb.ResultDB)
                    
97        finally:
                    
296
                    
297class TestSendMessage(unittest.TestCase):
                    
298
                    
                
test_subscriptions.py https://gitlab.com/jdfandino10/mailman | Python | 246 lines
                    
24
                    
25import unittest
                    
26
                    
29from mailman.interfaces.member import MemberRole
                    
30from mailman.interfaces.subscriptions import (
                    
31    ISubscriptionService, TooManyMembersError)
                    
38
                    
39class TestSubscriptionService(unittest.TestCase):
                    
40    layer = ConfigLayer
                    
76        self.assertEqual(len(members), 1)
                    
77        self.assertEqual(members[0].user, user)
                    
78
                    
239        self.assertEqual(cm.exception.subscriber, 'aperson@example.com')
                    
240        self.assertEqual(cm.exception.list_id, None)
                    
241        self.assertEqual(cm.exception.role, None)
                    
                
test_history.py https://gitlab.com/mkerfoot/home-assistant | Python | 202 lines
                    
7# pylint: disable=protected-access,too-many-public-methods
                    
8from datetime import timedelta
                    
9import os
                    
10import unittest
                    
11from unittest.mock import patch, sentinel
                    
12
                    
12
                    
13import homeassistant.core as ha
                    
14import homeassistant.util.dt as dt_util
                    
14import homeassistant.util.dt as dt_util
                    
15from homeassistant.components import history, recorder
                    
16
                    
20
                    
21class TestComponentHistory(unittest.TestCase):
                    
22    """ Tests homeassistant.components.history module. """
                    
                
test_bot.py https://gitlab.com/murder187ss/buildbot | Python | 429 lines
                    
15
                    
16from builtins import range
                    
17
                    
27from twisted.python import log
                    
28from twisted.trial import unittest
                    
29
                    
39
                    
40class TestBot(unittest.TestCase):
                    
41
                    
216
                    
217class TestWorkerForBuilder(command.CommandTestMixin, unittest.TestCase):
                    
218
                    
386
                    
387class TestBotFactory(unittest.TestCase):
                    
388
                    
                
test_richcmp.py https://gitlab.com/unofficial-mirrors/cpython | Python | 355 lines
                    
2
                    
3import unittest
                    
4from test import support
                    
95
                    
96class VectorTest(unittest.TestCase):
                    
97
                    
137
                    
138class NumberTest(unittest.TestCase):
                    
139
                    
280
                    
281class DictTest(unittest.TestCase):
                    
282
                    
305
                    
306class ListTest(unittest.TestCase):
                    
307
                    
                
test_platform.py https://gitlab.com/unofficial-mirrors/cpython | Python | 370 lines
                    
1from unittest import mock
                    
2import os
                    
2import os
                    
3import platform
                    
4import subprocess
                    
4import subprocess
                    
5import sys
                    
6import tempfile
                    
6import tempfile
                    
7import unittest
                    
8import warnings
                    
11
                    
12class PlatformTest(unittest.TestCase):
                    
13    def test_architecture(self):
                    
352
                    
353class DeprecationTest(unittest.TestCase):
                    
354
                    
                
testHod.py https://gitlab.com/essere.lab.public/qualitas.class-corpus | Python | 310 lines
                    
15#limitations under the License.
                    
16import unittest, getpass, os, sys, re, threading, time
                    
17
                    
24from testing.lib import BaseTestSuite, MockLogger, MockHadoopCluster
                    
25from hodlib.Hod.hod import hodRunner, hodState
                    
26from hodlib.Common.desc import NodePoolDesc
                    
64# Test class that defines methods to test invalid arguments to hod operations.
                    
65class test_InvalidArgsOperations(unittest.TestCase):
                    
66  def setUp(self):
                    
155    os.makedirs(clusterDir)
                    
156    self.assertTrue(os.path.isdir(clusterDir))
                    
157    jobid = '789.dummy.id1'
                    
206
                    
207class test_InvalidHodStateFiles(unittest.TestCase):
                    
208  def setUp(self):
                    
                
zaxis_test.py https://gitlab.com/goolic/peachyprintertools | Python | 185 lines
                    
1import unittest
                    
2import os
                    
4import time
                    
5import logging
                    
6from mock import MagicMock
                    
10
                    
11from peachyprinter.infrastructure.zaxis import SerialDripZAxis
                    
12from peachyprinter.infrastructure.messages import DripRecordedMessage, SetDripCountMessage, MoveToDripCountMessage
                    
14
                    
15class SerialDripZAxisTests(unittest.TestCase):
                    
16
                    
86        self.assertEqual(expected_height, mock_call_back.call_args_list[0][0][1])
                    
87        self.assertEqual(expected_average, mock_call_back.call_args_list[0][0][2])
                    
88        self.assertTrue(mock_call_back.call_args_list[0][0][3][0] >= start)
                    
178        self.assertEqual(expected_average, mock_call_back.call_args_list[0][0][2])
                    
179        self.assertTrue(mock_call_back.call_args_list[0][0][3][0] >= start)
                    
180        self.assertTrue(mock_call_back.call_args_list[0][0][3][0] <= end)
                    
                
native_heap_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 147 lines
                    
18
                    
19import unittest
                    
20
                    
23from memory_inspector.core import stacktrace
                    
24from memory_inspector.core import symbol
                    
25
                    
28
                    
29class NativeHeapTest(unittest.TestCase):
                    
30  def runTest(self):
                    
85
                    
86    self.assertEqual(st2[0].exec_file_rel_path, '/d/exe1')
                    
87    self.assertEqual(st2[0].exec_file_name, 'exe1')
                    
139    # not the last two, which lay on the second page which is noijt resident.
                    
140    self.assertEqual(alloc2.resident_size, 6)
                    
141
                    
                
committer_auth_unittest.py https://gitlab.com/x33n/phantomjs | Python | 220 lines
                    
29import os
                    
30import unittest
                    
31
                    
52
                    
53class CommitterAuthTest(unittest.TestCase):
                    
54    def setUp(self):
                    
103        auth.open_auth_json_file = self.invalid_auth_json_file
                    
104        self.assertFalse(auth.authenticate('committer@webkit.org', 'committerpassword'))
                    
105        self.assertEqual('Error parsing auth.json file: No JSON object could be decoded', auth.errmsg())
                    
108        self.auth.open_webkit_committers_file = self.invalid_committers_file
                    
109        self.assertFalse(self.auth.authenticate('committer@webkit.org', 'committerpassword'))
                    
110        self.assertEqual('Error parsing WebKit committers file', self.auth.errmsg())
                    
173        self.assertFalse(self.auth.authenticate('committer@webkit.org', 'wrongpassword'))
                    
174        self.assertEqual('Invalid username/password', self.auth.errmsg())
                    
175
                    
                
common_test.py https://gitlab.com/adam.lukaitis/fplutil | Python | 407 lines
                    
19import sys
                    
20import unittest
                    
21sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
                    
79    stderr: Standard error string that is the result of a call to this object.
                    
80    test_case: unittest.TestCase used to verify arguments.
                    
81  """
                    
87    Args:
                    
88      test_case: unittest.TestCase used to verify arguments.
                    
89      args: Expected command line arguments.
                    
199    expected: Expected arguments for make.
                    
200    test_case: unittest.TestCase used to verify make arguments.
                    
201  """
                    
205    Args:
                    
206      test_case: unittest.TestCase used to verify make arguments.
                    
207      expected: Expected arguments for make.
                    
                
test_db_migrate_versions_045_worker_transition.py https://gitlab.com/murder187ss/buildbot | Python | 384 lines
                    
19from twisted.internet import defer
                    
20from twisted.trial import unittest
                    
21
                    
21
                    
22from buildbot.db.types.json import JsonObject
                    
23from buildbot.test.util import migration
                    
26
                    
27class Migration(migration.MigrateTestMixin, unittest.TestCase):
                    
28
                    
193            ).order_by(c.id)
                    
194            self.assertEqual(
                    
195                q.execute().fetchall(), [
                    
209            # have no reference to it.
                    
210            self.assertEqual(
                    
211                q.execute().fetchall(), [
                    
                
test_dbm_dumb.py https://gitlab.com/unofficial-mirrors/cpython | Python | 299 lines
                    
6import operator
                    
7import os
                    
8import stat
                    
8import stat
                    
9import unittest
                    
10import dbm.dumb as dumbdbm
                    
22
                    
23class DumbDBMTestCase(unittest.TestCase):
                    
24    _dict = {b'0': b'',
                    
147        f = dumbdbm.open(_fname)
                    
148        self.assertEqual(f[b'1'], b'hello')
                    
149        self.assertEqual(f[b'2'], b'hello2')
                    
265            self.assertEqual(os.path.exists(_fname + '.dir'), value == 'w')
                    
266            self.assertFalse(os.path.exists(_fname + '.bak'))
                    
267
                    
                
error_handlers_unittest.py https://gitlab.com/x33n/phantomjs | Python | 196 lines
                    
25
                    
26import unittest2 as unittest
                    
27
                    
28from checker import StyleProcessorConfiguration
                    
29from error_handlers import DefaultStyleErrorHandler
                    
30from filter import FilterConfiguration
                    
32
                    
33class DefaultStyleErrorHandlerTest(unittest.TestCase):
                    
34
                    
134        self.assertEqual(0, self._error_count)
                    
135        self.assertEqual([], self._error_messages)
                    
136
                    
147        self._call_error_handler(error_handler, confidence)
                    
148        self.assertEqual(1, self._error_count)
                    
149        self.assertEqual(1, len(self._error_messages))
                    
                
test_test_util_validation.py https://gitlab.com/murder187ss/buildbot | Python | 200 lines
                    
14# Copyright Buildbot Team Members
                    
15import datetime
                    
16
                    
17from twisted.python import log
                    
18from twisted.trial import unittest
                    
19
                    
19
                    
20from buildbot.test.util import validation
                    
21from buildbot.util import UTC
                    
23
                    
24class VerifyDict(unittest.TestCase):
                    
25
                    
29            msgs = list(validator.validate('g', g))
                    
30            self.assertEqual(msgs, [], 'messages for %r' % (g,))
                    
31        for b in bad:
                    
                
test_document.py https://gitlab.com/jonnialva90/iridium-browser | Python | 346 lines
                    
4
                    
5from tests.unit import unittest, AWSMockServiceTestCase
                    
6from httpretty import HTTPretty
                    
6from httpretty import HTTPretty
                    
7from mock import MagicMock
                    
8
                    
34
                    
35class CloudSearchDocumentTest(unittest.TestCase):
                    
36    def setUp(self):
                    
154        for arg in args:
                    
155            self.assertTrue(arg['id'] in self.objs)
                    
156            self.assertEqual(arg['fields']['id'],
                    
344            self.assertTrue(hasattr(e, 'errors'))
                    
345            self.assertIsInstance(e.errors, list)
                    
346            self.assertEquals(e.errors[0], self.response['errors'][0].get('message'))
                    
                
caching_file_system_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 297 lines
                    
5
                    
6import os
                    
7import sys
                    
7import sys
                    
8import unittest
                    
9
                    
9
                    
10from caching_file_system import CachingFileSystem
                    
11from extensions_paths import SERVER2
                    
11from extensions_paths import SERVER2
                    
12from file_system import FileNotFoundError, StatInfo
                    
13from local_file_system import LocalFileSystem
                    
23
                    
24class CachingFileSystemTest(unittest.TestCase):
                    
25  def setUp(self):
                    
                
service_test.py https://gitlab.com/karambir/gdata | Python | 214 lines
                    
18
                    
19import unittest
                    
20try:
                    
37
                    
38class DocumentQueryTest(unittest.TestCase):
                    
39  
                    
53
                    
54class CellQueryTest(unittest.TestCase):
                    
55  
                    
89
                    
90class ListQueryTest(unittest.TestCase):
                    
91
                    
110
                    
111class SpreadsheetsServiceTest(unittest.TestCase):
                    
112
                    
                
manager_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 176 lines
                    
31
                    
32import sys
                    
33import time
                    
33import time
                    
34import unittest
                    
35
                    
47
                    
48class ManagerTest(unittest.TestCase):
                    
49    def test_needs_servers(self):
                    
92        self.assertEqual(self.http_stopped, True)
                    
93        self.assertEqual(self.websocket_stopped, False)
                    
94
                    
175                deleted_dir_count = deleted_dir_count + 1
                    
176        self.assertEqual(deleted_dir_count, 5)
                    
177
                    
                
list_of_scalar_values_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 277 lines
                    
4import os
                    
5import unittest
                    
6
                    
14
                    
15class StatisticComputationTest(unittest.TestCase):
                    
16  def testVariance(self):
                    
54
                    
55class TestBase(unittest.TestCase):
                    
56  def setUp(self):
                    
103    self.assertEquals(value.CONCATENATE, vM.same_page_merge_policy)
                    
104    self.assertEquals(True, vM.important)
                    
105    self.assertEquals([10, 9, 9, 7, 300, 302, 303, 304], vM.values)
                    
127    self.assertEquals(value.PICK_FIRST, vM.same_page_merge_policy)
                    
128    self.assertEquals(True, vM.important)
                    
129    self.assertEquals([1, 2], vM.values)
                    
                
gmock_class_test.py https://github.com/gromacs/gromacs.git | Python | 570 lines
                    
21import sys
                    
22import unittest
                    
23
                    
30
                    
31class TestCase(unittest.TestCase):
                    
32  """Helper class that adds assert methods."""
                    
79    # The constructors and destructor should be ignored.
                    
80    self.assertEqualIgnoreLeadingWhitespace(
                    
81        'MOCK_METHOD(int, Bar, (), (override));',
                    
243"""
                    
244    self.assertEqualIgnoreLeadingWhitespace(
                    
245        'MOCK_METHOD(void, Bar, (int a, char c), (override));',
                    
270"""
                    
271    self.assertEqualIgnoreLeadingWhitespace(
                    
272        'MOCK_METHOD(const string&, Bar, (int, int b), (override));',
                    
                
test_scripts_create_master.py https://gitlab.com/murder187ss/buildbot | Python | 244 lines
                    
14# Copyright Buildbot Team Members
                    
15from future.utils import itervalues
                    
16
                    
21from twisted.internet import defer
                    
22from twisted.trial import unittest
                    
23
                    
40
                    
41class TestCreateMaster(misc.StdoutAssertionsMixin, unittest.TestCase):
                    
42
                    
92class TestCreateMasterFunctions(www.WwwTestMixin, dirs.DirsMixin,
                    
93                                misc.StdoutAssertionsMixin, unittest.TestCase):
                    
94
                    
162        create_master.makeTAC(mkconfig(basedir='test', **{'no-logrotate': True}))
                    
163        self.assertNotInTacFile("import Log")
                    
164        self.assertWasQuiet()
                    
                
test_policy.py https://gitlab.com/unofficial-mirrors/cpython | Python | 346 lines
                    
1import io
                    
2import types
                    
3import textwrap
                    
4import unittest
                    
5import email.policy
                    
5import email.policy
                    
6import email.parser
                    
7import email.generator
                    
15
                    
16class PolicyAPITests(unittest.TestCase):
                    
17
                    
247
                    
248class TestPolicyPropagation(unittest.TestCase):
                    
249
                    
335
                    
336class TestConcretePolicies(unittest.TestCase):
                    
337
                    
                
io_tests.py https://gitlab.com/wilane/superdesk | Python | 155 lines
                    
11import os
                    
12import unittest
                    
13
                    
13
                    
14from superdesk.etree import etree, get_word_count
                    
15from superdesk.io import get_xml_parser
                    
16
                    
17from .newsml_1_2 import NewsMLOneParser
                    
18from .newsml_2_0 import NewsMLTwoParser
                    
27
                    
28class UtilsTest(unittest.TestCase):
                    
29
                    
50
                    
51class ItemTest(unittest.TestCase):
                    
52
                    
                
test_create_popcon_clusters.py https://gitlab.com/TCC-AppRecommender/scripts | Python | 241 lines
                    
2
                    
3import os
                    
4import shutil
                    
4import shutil
                    
5import unittest
                    
6
                    
6
                    
7import numpy as np
                    
8import create_popcon_clusters as cpc
                    
10
                    
11class CreatePopconClustersTests(unittest.TestCase):
                    
12
                    
66
                    
67        self.assertEqual(assert_all_pkgs, all_pkgs)
                    
68        self.assertEqual(sorted(assert_submissions.tolist()),
                    
                
test_urllib2net.py https://gitlab.com/atom-k/android-plus-plus | Python | 332 lines
                    
2
                    
3import unittest
                    
4from test import test_support
                    
34
                    
35class AuthTests(unittest.TestCase):
                    
36    """Tests urllib2 authentication features."""
                    
73
                    
74class CloseSocketTest(unittest.TestCase):
                    
75
                    
94
                    
95class OtherNetworkTests(unittest.TestCase):
                    
96    def setUp(self):
                    
252
                    
253class TimeoutTest(unittest.TestCase):
                    
254    def test_http_basic(self):
                    
                
cns_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 265 lines
                    
11import time
                    
12import unittest
                    
13import urllib2
                    
21
                    
22class PortAllocatorTest(unittest.TestCase):
                    
23  """Unit tests for the Port Allocator class."""
                    
106    # Ensure Get() succeeds and returns the correct port.
                    
107    self.assertEquals(self._pa.Get('test'), cns._DEFAULT_CNS_PORT_RANGE[0])
                    
108
                    
149
                    
150class ConstrainedNetworkServerTest(unittest.TestCase):
                    
151  """End to end tests for ConstrainedNetworkServer system.
                    
233
                    
234class ConstrainedNetworkServerUnitTests(unittest.TestCase):
                    
235  """ConstrainedNetworkServer class unit tests."""
                    
                
test_functions.py https://gitlab.com/atom-k/android-plus-plus | Python | 412 lines
                    
8from ctypes import *
                    
9import sys, unittest
                    
10
                    
16
                    
17import _ctypes_test
                    
18dll = CDLL(_ctypes_test.__file__)
                    
26                ("right", c_int), ("bottom", c_int)]
                    
27class FunctionTestCase(unittest.TestCase):
                    
28
                    
44
                    
45        from _ctypes import _Pointer
                    
46        try:
                    
51
                    
52        from _ctypes import _SimpleCData
                    
53        try:
                    
                
test_continuize.py https://gitlab.com/zaverichintan/orange3 | Python | 210 lines
                    
1import unittest
                    
2
                    
2
                    
3from Orange.data import Table, Variable
                    
4from Orange.preprocess.continuize import DomainContinuizer
                    
4from Orange.preprocess.continuize import DomainContinuizer
                    
5from Orange.preprocess import Continuize
                    
6from Orange.preprocess import transformation
                    
8
                    
9class ContinuizerTest(unittest.TestCase):
                    
10    def setUp(self):
                    
16            dom = DomainContinuizer(inp)
                    
17            self.assertTrue(all(attr.is_continuous
                    
18                                for attr in dom.attributes))
                    
18                                for attr in dom.attributes))
                    
19            self.assertIs(dom.class_var, self.data.domain.class_var)
                    
20            self.assertIs(dom[0], self.data.domain[0])
                    
                
leakdetector_unittest.py https://gitlab.com/x33n/phantomjs | Python | 152 lines
                    
28
                    
29import unittest2 as unittest
                    
30
                    
30
                    
31from webkitpy.port.leakdetector import LeakDetector
                    
32from webkitpy.common.system.filesystem_mock import MockFileSystem
                    
32from webkitpy.common.system.filesystem_mock import MockFileSystem
                    
33from webkitpy.common.system.outputcapture import OutputCapture
                    
34from webkitpy.common.system.executive_mock import MockExecutive
                    
36
                    
37class LeakDetectorTest(unittest.TestCase):
                    
38    def _mock_port(self):
                    
53        expected_args = ['--exclude-callstack=foo bar', '--exclude-callstack=BAZ', '--exclude-type=abcdefg', '--exclude-type=hi jklmno', 1234]
                    
54        self.assertEqual(detector._leaks_args(1234), expected_args)
                    
55
                    
                
gmock_class_test.py https://gitlab.com/stuckyb/fastpcm | Python | 466 lines
                    
24import sys
                    
25import unittest
                    
26
                    
30from cpp import ast
                    
31from cpp import gmock_class
                    
32
                    
33
                    
34class TestCase(unittest.TestCase):
                    
35  """Helper class that adds assert methods."""
                    
192"""
                    
193    self.assertEqualIgnoreLeadingWhitespace(
                    
194        'MOCK_METHOD2(Bar,\nvoid(int, char));',
                    
204"""
                    
205    self.assertEqualIgnoreLeadingWhitespace(
                    
206        'MOCK_METHOD2(Bar,\nvoid(int, char));',
                    
                
test_hash.py https://gitlab.com/unofficial-mirrors/cpython | Python | 346 lines
                    
8import sys
                    
9import unittest
                    
10from test.support.script_helper import assert_python_ok
                    
157
                    
158class HashBuiltinsTestCase(unittest.TestCase):
                    
159    hashes_to_check = [enumerate(range(10)),
                    
319
                    
320class DatetimeDatetimeTests(DatetimeTests, unittest.TestCase):
                    
321    repr_ = repr(datetime.datetime(1, 2, 3, 4, 5, 6, 7))
                    
322
                    
323class DatetimeTimeTests(DatetimeTests, unittest.TestCase):
                    
324    repr_ = repr(datetime.time(0))
                    
326
                    
327class HashDistributionTestCase(unittest.TestCase):
                    
328
                    
                
test_drawing_image01.py https://gitlab.com/Ferraresi/TestAcademiadaCarne | Python | 146 lines
                    
7
                    
8import unittest
                    
9from ...compatibility import StringIO
                    
9from ...compatibility import StringIO
                    
10from ..helperfunctions import _xml_to_list
                    
11from ...drawing import Drawing
                    
13
                    
14class TestAssembleDrawing(unittest.TestCase):
                    
15    """
                    
77
                    
78        self.assertEqual(got, exp)
                    
79
                    
145
                    
146        self.assertEqual(got, exp)
                    
147
                    
                
test_scripts_runner.py https://gitlab.com/murder187ss/buildbot | Python | 411 lines
                    
81
                    
82class TestMakerBase(BaseDirTestsMixin, unittest.TestCase):
                    
83
                    
119
                    
120class TestRestartOptions(OptionsMixin, BaseDirTestsMixin, unittest.TestCase):
                    
121
                    
137
                    
138class TestCreateWorkerOptions(OptionsMixin, unittest.TestCase):
                    
139
                    
293
                    
294class TestOptions(misc.StdoutAssertionsMixin, unittest.TestCase):
                    
295
                    
327
                    
328class TestRun(misc.StdoutAssertionsMixin, unittest.TestCase):
                    
329
                    
                
test_install.py https://bitbucket.org/mirror/cpython/ | Python | 392 lines
                    
6
                    
7from packaging import install
                    
8from packaging.pypi.xmlrpc import Client
                    
9from packaging.metadata import Metadata
                    
10from packaging.tests.support import (LoggingCatcher, TempdirManager, unittest,
                    
11                                     fake_dec)
                    
96
                    
97class TestInstall(LoggingCatcher, TempdirManager, unittest.TestCase):
                    
98    def _get_client(self, server, *args, **kwargs):
                    
175        self.assertIn(('bacon', '0.1'), remove)
                    
176        self.assertEqual(0, len(output['conflict']))
                    
177
                    
386    suite = unittest.TestSuite()
                    
387    suite.addTest(unittest.makeSuite(TestInstall))
                    
388    return suite
                    
                
test_migrations.py https://gitlab.com/noc0lour/mailman | Python | 298 lines
                    
20import os
                    
21import unittest
                    
22import sqlalchemy as sa
                    
24
                    
25from mailman.app.lifecycle import create_list
                    
26from mailman.config import config
                    
38
                    
39class TestMigrations(unittest.TestCase):
                    
40    layer = ConfigLayer
                    
161        for i in range(1, 5):
                    
162            self.assertIn('type', results[i])
                    
163        self.assertEqual(results[1]['type'], 'probe')
                    
223            os.path.join(config.LIST_DATA_DIR, 'ant@example.com')))
                    
224        self.assertTrue(os.path.exists(ant.data_path))
                    
225        self.assertTrue(os.path.exists(bee.data_path))
                    
                
test_routes.py https://gitlab.com/goolic/pyramid | Python | 255 lines
                    
1import unittest
                    
2
                    
3from pyramid.tests.test_config import dummyfactory
                    
4from pyramid.tests.test_config import DummyContext
                    
5from pyramid.compat import text_
                    
6
                    
7class RoutesConfiguratorMixinTests(unittest.TestCase):
                    
8    def _makeOne(self, *arg, **kw):
                    
8    def _makeOne(self, *arg, **kw):
                    
9        from pyramid.config import Configurator
                    
10        config = Configurator(*arg, **kw)
                    
102        request.method = 'POST'
                    
103        self.assertEqual(predicate(None, request), False)
                    
104
                    
111        request.upath_info = '/foo'
                    
112        self.assertEqual(predicate(None, request), True)
                    
113        request = self._makeRequest(config)
                    
                
test_authorization.py https://gitlab.com/goolic/pyramid | Python | 259 lines
                    
1import unittest
                    
2
                    
2
                    
3from pyramid.testing import cleanUp
                    
4
                    
4
                    
5class TestACLAuthorizationPolicy(unittest.TestCase):
                    
6    def setUp(self):
                    
12    def _getTargetClass(self):
                    
13        from pyramid.authorization import ACLAuthorizationPolicy
                    
14        return ACLAuthorizationPolicy
                    
19    def test_class_implements_IAuthorizationPolicy(self):
                    
20        from zope.interface.verify import verifyClass
                    
21        from pyramid.interfaces import IAuthorizationPolicy
                    
24    def test_instance_implements_IAuthorizationPolicy(self):
                    
25        from zope.interface.verify import verifyObject
                    
26        from pyramid.interfaces import IAuthorizationPolicy
                    
                
chrome_tracing_agent_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 277 lines
                    
3# found in the LICENSE file.
                    
4import os
                    
5import platform
                    
6import stat
                    
7import unittest
                    
8
                    
8
                    
9from telemetry import decorators
                    
10from telemetry.internal.platform.tracing_agent import chrome_tracing_agent
                    
10from telemetry.internal.platform.tracing_agent import chrome_tracing_agent
                    
11from telemetry.internal.platform.tracing_agent import (
                    
12    chrome_tracing_devtools_manager)
                    
73
                    
74class ChromeTracingAgentTest(unittest.TestCase):
                    
75  def setUp(self):
                    
                
test_encoding.py https://gitlab.com/asmjahid/django | Python | 151 lines
                    
4import datetime
                    
5import unittest
                    
6
                    
11)
                    
12from django.utils.functional import SimpleLazyObject
                    
13from django.utils.http import urlquote_plus
                    
15
                    
16class TestEncodingUtils(unittest.TestCase):
                    
17    def test_force_text_exception(self):
                    
75        self.assertEqual(smart_text(TestU()), '\u0160\u0110\u0106\u017d\u0107\u017e\u0161\u0111')
                    
76        self.assertEqual(smart_text(1), '1')
                    
77        self.assertEqual(smart_text('foo'), 'foo')
                    
79
                    
80class TestRFC3987IEncodingUtils(unittest.TestCase):
                    
81
                    
                
testing.py https://gitlab.com/adam.lukaitis/muzei | Python | 592 lines
                    
2
                    
3import copy
                    
4import functools
                    
4import functools
                    
5import unittest
                    
6from unittest import TestCase
                    
6from unittest import TestCase
                    
7from bs4 import BeautifulSoup
                    
8from bs4.element import (
                    
15
                    
16from bs4.builder import HTMLParserTreeBuilder
                    
17default_builder = HTMLParserTreeBuilder
                    
19
                    
20class SoupTest(unittest.TestCase):
                    
21
                    
                
MSVSSettings_test.py https://gitlab.com/boxnia/NFU_MOVIL | Python | 1117 lines
                    
9import StringIO
                    
10import unittest
                    
11import gyp.MSVSSettings as MSVSSettings
                    
13
                    
14class TestSequenceFunctions(unittest.TestCase):
                    
15
                    
23    actual = [line for line in actual if line]
                    
24    self.assertEqual(sorted(expected), sorted(actual))
                    
25
                    
143             'IgnoreEmbeddedIDL': 'true',
                    
144             'IgnoreImportLibrary': 'true',
                    
145             'ImportLibrary': 'a_file_name',
                    
                
test_paragraph.py https://gitlab.com/unofficial-mirrors/cpython | Python | 376 lines
                    
1# Test the functions and main class method of paragraph.py
                    
2import unittest
                    
3from idlelib import paragraph as fp
                    
39
                    
40class FindTest(unittest.TestCase):
                    
41    """Test the find_paragraph function in paragraph module.
                    
158
                    
159class ReformatFunctionTest(unittest.TestCase):
                    
160    """Test the reformat_paragraph function without the editor window."""
                    
210
                    
211class FormatClassTest(unittest.TestCase):
                    
212    def test_init_close(self):
                    
242
                    
243class FormatEventTest(unittest.TestCase):
                    
244    """Test the formatting of text inside a Text widget.
                    
                
logtesting.py https://gitlab.com/jonnialva90/iridium-browser | Python | 258 lines
                    
51        Args:
                    
52          test_case: A unittest.TestCase instance.
                    
53
                    
83
                    
84          class SampleTest(unittest.TestCase):
                    
85
                    
141        Args:
                    
142          test_case: A unittest.TestCase instance.
                    
143          logging_level: An integer logging level that is the minimum level
                    
215# FIXME: Rename this class to LoggingTestCaseBase to be sure that
                    
216#        the unittest module does not interpret this class as a unittest
                    
217#        test case itself.
                    
217#        test case itself.
                    
218class LoggingTestCase(unittest.TestCase):
                    
219
                    
                
printing_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 251 lines
                    
34import time
                    
35import unittest
                    
36
                    
38
                    
39from webkitpy.common.system import logtesting
                    
40from webkitpy.layout_tests import port
                    
53
                    
54class TestUtilityFunctions(unittest.TestCase):
                    
55    def test_print_options(self):
                    
81
                    
82class  Testprinter(unittest.TestCase):
                    
83    def assertEmpty(self, stream):
                    
135        self.assertIn('View the test results at file:///tmp', err.getvalue())
                    
136        self.assertIn('View the archived results dashboard at file:///tmp', err.getvalue())
                    
137        self.assertIn('Baseline search path: test-mac-leopard -> test-mac-snowleopard -> generic', err.getvalue())
                    
                
test_member.py https://gitlab.com/noc0lour/mailman | Python | 123 lines
                    
19
                    
20import unittest
                    
21
                    
24from mailman.interfaces.member import MemberRole, MembershipError
                    
25from mailman.interfaces.user import UnverifiedAddressError
                    
26from mailman.interfaces.usermanager import IUserManager
                    
30from mailman.utilities.datetime import now
                    
31from zope.component import getUtility
                    
32
                    
33
                    
34class TestMember(unittest.TestCase):
                    
35    layer = ConfigLayer
                    
61        # The new address is not verified.
                    
62        self.assertRaises(UnverifiedAddressError,
                    
63                          setattr, member, 'address', new_address)
                    
                
filesystem_unittest.py https://gitlab.com/x33n/phantomjs | Python | 264 lines
                    
30# NOTE: The fileencoding comment on the first line of the file is
                    
31# important; without it, Python will choke while trying to parse the file,
                    
32# since it includes non-ASCII characters.
                    
33
                    
34import os
                    
35import stat
                    
35import stat
                    
36import sys
                    
37import tempfile
                    
37import tempfile
                    
38import unittest2 as unittest
                    
39
                    
76
                    
77class RealFileSystemTest(unittest.TestCase, GenericFileSystemTests):
                    
78    def setUp(self):
                    
                
testRingmasterRPCs.py https://gitlab.com/essere.lab.public/qualitas.class-corpus | Python | 171 lines
                    
15#limitations under the License.
                    
16import unittest, os, sys, re, threading, time
                    
17
                    
55# All test-case classes should have the naming convention test_.*
                    
56class test_MINITEST1(unittest.TestCase):
                    
57  def setUp(self):
                    
69
                    
70class test_Multiple_Workers(unittest.TestCase):
                    
71  def setUp(self):
                    
93    cmdList = self.rpcSet.getCommand('host1')
                    
94    self.assertEquals(len(cmdList), 2)
                    
95    self.assertEquals(cmdList[0].dict['argv'][0], 'namenode')
                    
120
                    
121class test_GetCommand(unittest.TestCase):
                    
122  def setUp(self):
                    
                
test_registry.py https://gitlab.com/goolic/pyramid | Python | 378 lines
                    
1import unittest
                    
2
                    
2
                    
3class TestRegistry(unittest.TestCase):
                    
4    def _getTargetClass(self):
                    
43        registry = self._makeOne()
                    
44        self.assertEqual(registry.has_listeners, False)
                    
45        from zope.interface import Interface
                    
59
                    
60class TestIntrospector(unittest.TestCase):
                    
61    def _getTargetClass(slf):
                    
152            ])]
                    
153        self.assertEqual(
                    
154            inst.categorized(sort_key=operator.attrgetter('foo')), expected)
                    
271
                    
272class TestIntrospectable(unittest.TestCase):
                    
273    def _getTargetClass(slf):
                    
                
test_plugins.py https://gitlab.com/murder187ss/buildbot | Python | 400 lines
                    
17"""
                    
18import re
                    
19
                    
19
                    
20import mock
                    
21
                    
21
                    
22from twisted.trial import unittest
                    
23
                    
150@mock.patch('buildbot.plugins.db.iter_entry_points', provide_fake_entries)
                    
151class TestBuildbotPlugins(unittest.TestCase):
                    
152
                    
284
                    
285class TestWorkerPluginsTransition(unittest.TestCase):
                    
286
                    
                
xmlrunner.py https://gitlab.com/jonnialva90/iridium-browser | Python | 376 lines
                    
14import random
                    
15import unittest
                    
16import xmlrunner
                    
17
                    
18class TestSequenceFunctions(unittest.TestCase):
                    
19    def setUp(self):
                    
32    def test_sample(self):
                    
33        self.assertRaises(ValueError, random.sample, self.seq, 20)
                    
34        for element in random.sample(self.seq, 5):
                    
37if __name__ == '__main__':
                    
38    unittest.main(testRunner=xmlrunner.XMLTestRunner(output='test-reports'))
                    
39"""
                    
43import time
                    
44from unittest import TestResult, _TextTestResult, TextTestRunner
                    
45from cStringIO import StringIO
                    
                
test_mutable_list.py https://gitlab.com/gregtyka/Scryve-Webapp | Python | 398 lines
                    
5# released under the New BSD license.
                    
6import unittest
                    
7from django.contrib.gis.geos.mutable_list import ListMixin
                    
45
                    
46class ListMixinTest(unittest.TestCase):
                    
47    """
                    
68        for i in self.limits_plus(1):
                    
69            self.assertEqual(pl[i:], ul[i:], 'slice [%d:]' % (i))
                    
70            self.assertEqual(pl[:i], ul[:i], 'slice [:%d]' % (i))
                    
72            for j in self.limits_plus(1):
                    
73                self.assertEqual(pl[i:j], ul[i:j], 'slice [%d:%d]' % (i,j))
                    
74                for k in self.step_range():
                    
74                for k in self.step_range():
                    
75                    self.assertEqual(pl[i:j:k], ul[i:j:k], 'slice [%d:%d:%d]' % (i,j,k))
                    
76
                    
                
haslanded_unittest.py https://gitlab.com/x33n/phantomjs | Python | 299 lines
                    
28
                    
29import unittest2 as unittest
                    
30import subprocess
                    
34
                    
35class HasLandedTest(unittest.TestCase):
                    
36    maxDiff = None
                    
37
                    
38    @unittest.skipUnless(subprocess.call('which interdiff', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0, "requires interdiff")
                    
39    def test_run(self):
                    
215+
                    
216 from .attachment import Attachment
                    
217 
                    
296
                    
297        self.assertMultiLineEqual(testexpected1, HasLanded.strip_change_log(testbefore1))
                    
298        self.assertMultiLineEqual(testexpected1, HasLanded.strip_change_log(testafter1))
                    
                
testing.py git://pkgs.fedoraproject.org/python-tornado | Python | 382 lines
                    
4
                    
5* `AsyncTestCase`/`AsyncHTTPTestCase`:  Subclasses of unittest.TestCase
                    
6  with additional support for testing asynchronous (IOLoop-based) code.
                    
7
                    
8* `LogTrapTestCase`:  Subclass of unittest.TestCase that discards log output
                    
9  from tests that pass and only produces output for failing tests.
                    
38import time
                    
39import unittest
                    
40
                    
48
                    
49class AsyncTestCase(unittest.TestCase):
                    
50    """TestCase subclass for testing IOLoop-based asynchronous code.
                    
270
                    
271class LogTrapTestCase(unittest.TestCase):
                    
272    """A test case that captures and discards all logging output
                    
                
test_suite.py https://gitlab.com/ZoZworc/install | Python | 367 lines
                    
10class Test(object):
                    
11    class Foo(unittest.TestCase):
                    
12        def test_1(self): pass
                    
22
                    
23class Test_TestSuite(unittest.TestCase, TestEquality):
                    
24
                    
28    # Used by TestEquality.test_eq
                    
29    eq_pairs = [(unittest.TestSuite(), unittest.TestSuite()),
                    
30                (unittest.TestSuite(), unittest.TestSuite([])),
                    
128    def test_countTestCases_zero_nested(self):
                    
129        class Test1(unittest.TestCase):
                    
130            def test(self):
                    
132
                    
133        suite = unittest.TestSuite([unittest.TestSuite()])
                    
134
                    
                
test_kqueue.py https://gitlab.com/unofficial-mirrors/cpython | Python | 239 lines
                    
3"""
                    
4import errno
                    
5import os
                    
5import os
                    
6import select
                    
7import socket
                    
8import time
                    
9import unittest
                    
10
                    
11if not hasattr(select, "kqueue"):
                    
12    raise unittest.SkipTest("test works only on BSD")
                    
13
                    
13
                    
14class TestKQueue(unittest.TestCase):
                    
15    def test_create_queue(self):
                    
                
test.py https://gitlab.com/wilane/tropo-webapi-python | Python | 342 lines
                    
12        try:
                    
13            import simplejson as jsonlib
                    
14        except ImportError:
                    
16
                    
17import unittest 
                    
18import sys
                    
22
                    
23class TestTropoPython(unittest.TestCase):        
                    
24    """
                    
67        # print "test_call: %s" % tropo.RenderJson()
                    
68        self.assertEqual(rendered_obj, wanted_obj)
                    
69
                    
275        wanted_obj = jsonlib.loads(wanted_json)
                    
276        self.assertEqual(rendered_obj, wanted_obj)
                    
277
                    
                
test_zipimport_support.py https://gitlab.com/unofficial-mirrors/cpython | Python | 244 lines
                    
8import sys
                    
9import textwrap
                    
10import zipfile
                    
10import zipfile
                    
11import zipimport
                    
12import doctest
                    
14import linecache
                    
15import unittest
                    
16from test.support.script_helper import (spawn_python, kill_python, assert_python_ok,
                    
54
                    
55class ZipSupportTests(unittest.TestCase):
                    
56    # This used to use the ImportHooksBaseTestCase to restore
                    
56    # This used to use the ImportHooksBaseTestCase to restore
                    
57    # the state of the import related information
                    
58    # in the sys module after each test. However, that restores
                    
                
test_jedibackend.py https://gitlab.com/csagedy/prelude | Python | 286 lines
                    
3import sys
                    
4import unittest
                    
5
                    
16from elpy.tests.support import RPCGetDocstringTests
                    
17from elpy.tests.support import RPCGetDefinitionTests
                    
18from elpy.tests.support import RPCGetCalltipTests
                    
141
                    
142class TestPosToLinecol(unittest.TestCase):
                    
143    def test_should_handle_beginning_of_string(self):
                    
155
                    
156class TestLinecolToPos(unittest.TestCase):
                    
157    def test_should_handle_beginning_of_string(self):
                    
179
                    
180class TestRunWithDebug(unittest.TestCase):
                    
181    @mock.patch('jedi.Script')
                    
                
test_callbacks.py https://gitlab.com/unofficial-mirrors/cpython | Python | 282 lines
                    
1import functools
                    
2import unittest
                    
3from ctypes import *
                    
6
                    
7class Callbacks(unittest.TestCase):
                    
8    functype = CFUNCTYPE
                    
29        if typ == c_float:
                    
30            self.assertAlmostEqual(result, arg, places=5)
                    
31        else:
                    
121        prototype = self.functype.__func__(object)
                    
122        self.assertRaises(TypeError, prototype, lambda: None)
                    
123
                    
156
                    
157class SampleCallbacksTestCase(unittest.TestCase):
                    
158
                    
                
update_perf_expectations_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 204 lines
                    
7from StringIO import StringIO
                    
8import unittest
                    
9import make_expectations as perf_ex_lib
                    
9import make_expectations as perf_ex_lib
                    
10import update_perf_expectations as upe_mod
                    
11
                    
38      # Make sure there is no "sha1".
                    
39      self.assertFalse('sha1' in new_test_value)
                    
40      # Make sure reva and revb values are correctly set.
                    
47      self.assertEqual(original_test_value['sha1'], new_test_value['sha1'])
                    
48      self.assertEqual(original_test_value['reva'], new_test_value['reva'])
                    
49      self.assertEqual(original_test_value['revb'], new_test_value['revb'])
                    
51
                    
52class UpdatePerfExpectationsTest(unittest.TestCase):
                    
53  def testFilterMatch(self):
                    
                
test_configure.py https://gitlab.com/smoke.torez/aws-cli | Python | 237 lines
                    
16from awscli.customizations.configure import configure, ConfigValue, NOT_SET
                    
17from awscli.testutils import unittest
                    
18
                    
21
                    
22class TestConfigureCommand(unittest.TestCase):
                    
23
                    
131
                    
132class TestInteractivePrompter(unittest.TestCase):
                    
133
                    
148        # First we should return the value from raw_input.
                    
149        self.assertEqual(response, 'foo')
                    
150        # We should also not display the entire access key.
                    
199
                    
200class TestConfigValueMasking(unittest.TestCase):
                    
201
                    
                
test_prequest.py https://gitlab.com/goolic/pyramid | Python | 235 lines
                    
1import unittest
                    
2
                    
2
                    
3class TestPRequestCommand(unittest.TestCase):
                    
4    def _getTargetClass(self):
                    
4    def _getTargetClass(self):
                    
5        from pyramid.scripts.prequest import PRequestCommand
                    
6        return PRequestCommand
                    
33        command.run()
                    
34        self.assertEqual(self._out, ['You must provide at least two arguments'])
                    
35
                    
38        command.run()
                    
39        self.assertEqual(self._path_info, '/')
                    
40        self.assertEqual(self._spec, 'development.ini')
                    
227
                    
228class Test_main(unittest.TestCase):
                    
229    def _callFUT(self, argv):
                    
                
test_zipapp.py https://gitlab.com/unofficial-mirrors/cpython | Python | 349 lines
                    
7import tempfile
                    
8import unittest
                    
9import zipapp
                    
11
                    
12from unittest.mock import patch
                    
13
                    
13
                    
14class ZipAppTest(unittest.TestCase):
                    
15
                    
153        zipapp.create_archive(str(source), target, interpreter='python')
                    
154        self.assertTrue(target.getvalue().startswith(b'#!python\n'))
                    
155
                    
270
                    
271class ZipAppCmdlineTest(unittest.TestCase):
                    
272
                    
                
test_shlex.py https://gitlab.com/unofficial-mirrors/cpython | Python | 318 lines
                    
3import string
                    
4import unittest
                    
5
                    
136
                    
137class ShlexTest(unittest.TestCase):
                    
138    def setUp(self):
                    
171            l = self.oldSplit(self.data[i][0])
                    
172            self.assertEqual(l, self.data[i][1:],
                    
173                             "%s: %s != %s" %
                    
255                observed.append((t, tt))
                    
256            self.assertEqual(observed, expected)
                    
257
                    
261        self.assertNotIn('_', s.wordchars)
                    
262        self.assertEqual(list(s), ['a', '_', 'b', '__', 'c'])
                    
263
                    
                
test_keyword.py https://gitlab.com/unofficial-mirrors/cpython | Python | 138 lines
                    
1import keyword
                    
2import unittest
                    
3from test import support
                    
7import subprocess
                    
8import shutil
                    
9import textwrap
                    
19
                    
20class Test_iskeyword(unittest.TestCase):
                    
21    def test_true_is_a_keyword(self):
                    
38
                    
39class TestKeywordGeneration(unittest.TestCase):
                    
40
                    
61        self.addCleanup(support.unlink, TEST_PY_FILE)
                    
62        self.assertFalse(filecmp.cmp(KEYWORD_FILE, TEST_PY_FILE))
                    
63        self.assertEqual((0, b''), self._generate_keywords(GRAMMAR_FILE,
                    
                
test_datastore.py git://github.com/bashwork/pymodbus.git | Python | 410 lines
                    
1#!/usr/bin/env python
                    
2import unittest
                    
3import mock
                    
15
                    
16class ModbusDataStoreTest(unittest.TestCase):
                    
17    '''
                    
101        block = ModbusSparseDataBlock({3: [10, 11, 12], 10: 1, 15: [0] * 4})
                    
102        self.assertEqual(block.values, {3: 10, 4: 11, 5: 12, 10: 1,
                    
103                                        15:0 , 16:0, 17:0, 18:0 })
                    
177
                    
178class RedisDataStoreTest(unittest.TestCase):
                    
179    '''
                    
278
                    
279class SqlDataStoreTest(unittest.TestCase):
                    
280    '''
                    
                
test_vpc_peering_connection.py https://gitlab.com/jonnialva90/iridium-browser | Python | 275 lines
                    
21
                    
22from tests.unit import mock, unittest
                    
23from tests.unit import AWSMockServiceTestCase
                    
83            if vpc_peering_connection.id == 'pcx-111aaa22':
                    
84                self.assertEqual(vpc_peering_connection.id, 'pcx-111aaa22')
                    
85                self.assertEqual(vpc_peering_connection.status_code, 'pending-acceptance')
                    
138        self.assertEqual(vpc_peering_connection.status_code, 'initiating-request')
                    
139        self.assertEqual(vpc_peering_connection.status_message, 'Initiating Request to 123456789012')
                    
140        self.assertEqual(vpc_peering_connection.requester_vpc_info.owner_id, '777788889999')
                    
161
                    
162class TestDeleteVpcPeeringConnectionShortForm(unittest.TestCase):
                    
163    DESCRIBE_VPC_PEERING_CONNECTIONS= b"""<?xml version="1.0" encoding="UTF-8"?>
                    
269        self.assertEqual(vpc_peering_connection.accepter_vpc_info.vpc_id, 'vpc-111aaa22')
                    
270        self.assertEqual(vpc_peering_connection.accepter_vpc_info.cidr_block, '10.0.1.0/28')
                    
271
                    
                
test_robotparser.py https://gitlab.com/unofficial-mirrors/cpython | Python | 332 lines
                    
2import os
                    
3import unittest
                    
4import urllib.robotparser
                    
102
                    
103class CrawlDelayAndRequestRateTest(BaseRequestRateTest, unittest.TestCase):
                    
104    robots_txt = """\
                    
201
                    
202class DisallowQueryStringTest(BaseRobotTest, unittest.TestCase):
                    
203    # see issue #6325 for details
                    
211
                    
212class UseFirstUserAgentWildcardTest(BaseRobotTest, unittest.TestCase):
                    
213    # obey first * entry (#4108)
                    
289
                    
290class NetworkTestCase(unittest.TestCase):
                    
291
                    
                
test_atexit.py https://gitlab.com/unofficial-mirrors/cpython | Python | 181 lines
                    
1import sys
                    
2import unittest
                    
3import io
                    
26
                    
27class GeneralTest(unittest.TestCase):
                    
28
                    
93        self.assertEqual(stderr.count("ZeroDivisionError"), 3)
                    
94        self.assertIn("# one", stderr)
                    
95        self.assertIn("# two", stderr)
                    
95        self.assertIn("# two", stderr)
                    
96        self.assertIn("# three", stderr)
                    
97
                    
145
                    
146class SubinterpreterTest(unittest.TestCase):
                    
147
                    
                
test_enumerate.py https://gitlab.com/atom-k/android-plus-plus | Python | 255 lines
                    
1import unittest
                    
2import sys
                    
63
                    
64class EnumerateTestCase(unittest.TestCase):
                    
65
                    
71        e = self.enum(self.seq)
                    
72        self.assertEqual(iter(e), e)
                    
73        self.assertEqual(list(self.enum(self.seq)), self.res)
                    
109        # whenever nothing else holds a reference to it
                    
110        self.assertEqual(len(set(map(id, list(enumerate(self.seq))))), len(self.seq))
                    
111        self.assertEqual(len(set(map(id, enumerate(self.seq)))), min(1,len(self.seq)))
                    
128
                    
129class TestReversed(unittest.TestCase):
                    
130
                    
243def test_main(verbose=None):
                    
244    test_support.run_unittest(__name__)
                    
245
                    
                
topology_building_unittest.py http://pythonocc.googlecode.com/svn/trunk/ | Python | 297 lines
                    
19from OCC.BRepBuilderAPI import *
                    
20from OCC.GeomAPI import *
                    
21from OCC.Geom import *
                    
23from OCC.TColgp import *
                    
24from OCC.Geom2d import *
                    
25from OCC.TColgp import *
                    
31from OCC.Precision import *
                    
32from OCC.BRepLib import *
                    
33
                    
34import math, sys
                    
35import unittest
                    
36
                    
36
                    
37class TestTopologyBuilding(unittest.TestCase):
                    
38    def test_edge(self):
                    
                
optimize_webui_test.py git://github.com/chromium/chromium.git | Python | 221 lines
                    
7import os
                    
8import shutil
                    
9import tempfile
                    
9import tempfile
                    
10import unittest
                    
11
                    
15
                    
16class OptimizeWebUiTest(unittest.TestCase):
                    
17  def setUp(self):
                    
125    self.assertIn('element.js', depfile_d)
                    
126    self.assertIn(os.path.normpath('element_in_dir/element_in_dir.js'),
                    
127                  depfile_d)
                    
217    depfile_d = self._read_out_file('depfile.d')
                    
218    self.assertIn('lazy_element.js', depfile_d)
                    
219
                    
                
test_modulefinder.py https://gitlab.com/unofficial-mirrors/cpython | Python | 337 lines
                    
2import errno
                    
3import importlib.machinery
                    
4import py_compile
                    
55b/__init__.py
                    
56                                from __future__ import absolute_import
                    
57                                from sys import *
                    
246
                    
247class ModuleFinderTest(unittest.TestCase):
                    
248    def _do_test(self, info, report=False, debug=0, replace_paths=[]):
                    
253                                           replace_paths=replace_paths)
                    
254            mf.import_hook(import_this)
                    
255            if report:
                    
260##                try:
                    
261##                    __import__(import_this)
                    
262##                except:
                    
                
testEvaluation.py https://gitlab.com/diao/kfz_auto | Python | 344 lines
                    
1import unittest
                    
2
                    
6
                    
7class EvaluationTestCase(unittest.TestCase):
                    
8    def setUp(self):
                    
29        # 验证提交成功
                    
30        self.assertEqual('添加评价成功!',
                    
31                         self.action.get_msg_bar_text())
                    
39        # 验证评价过的订单数据载入正确性
                    
40        self.assertTrue(self.action.evalPage.bad_eval.is_selected() and
                    
41                        self.action.evalPage.quality_1.is_selected() and
                    
170        # 验证删除成功
                    
171        self.assertEqual('我的回复:暂无回复', self.action.get_reply_text())
                    
172
                    
176        # 验证修改评价成功
                    
177        self.assertEqual('修改评价成功!',
                    
178                         self.action.get_msg_bar_text())
                    
                
test_asn1.py https://gitlab.com/Smileyt/KomodoEdit | Python | 290 lines
                    
26
                    
27import unittest
                    
28import sys
                    
29
                    
30from Crypto.Util.asn1 import DerSequence, DerObject
                    
31
                    
31
                    
32class DerObjectTests(unittest.TestCase):
                    
33
                    
36		der = DerObject('\x33')
                    
37		self.assertEquals(der.encode(), '\x33\x00')
                    
38		# Small payload
                    
70
                    
71class DerSequenceTests(unittest.TestCase):
                    
72
                    
                
test_pty.py https://gitlab.com/atom-k/android-plus-plus | Python | 289 lines
                    
1from test.test_support import verbose, run_unittest, import_module
                    
2
                    
9import os
                    
10import sys
                    
11import select
                    
13import socket
                    
14import unittest
                    
15
                    
51# XXX(nnorwitz):  these tests leak fds when there is an error.
                    
52class PtyTest(unittest.TestCase):
                    
53    def setUp(self):
                    
90            s1 = os.read(master_fd, 1024)
                    
91            self.assertEqual('', s1)
                    
92        except OSError, e:
                    
198
                    
199class SmallPtyTests(unittest.TestCase):
                    
200    """These tests don't spawn children or hang."""
                    
                
test_master.py https://gitlab.com/murder187ss/buildbot | Python | 264 lines
                    
22from twisted.python import log
                    
23from twisted.trial import unittest
                    
24
                    
31from buildbot.test.fake import fakedb
                    
32from buildbot.test.fake import fakemq
                    
33from buildbot.test.util import dirs
                    
33from buildbot.test.util import dirs
                    
34from buildbot.test.util import logging
                    
35
                    
36
                    
37class OldTriggeringMethods(unittest.TestCase):
                    
38
                    
120
                    
121class StartupAndReconfig(dirs.DirsMixin, logging.LoggingMixin, unittest.TestCase):
                    
122
                    
                
test_alexa.py https://gitlab.com/mkerfoot/home-assistant | Python | 323 lines
                    
7# pylint: disable=protected-access,too-many-public-methods
                    
8import unittest
                    
9import json
                    
15
                    
16from tests.common import get_test_instance_port, get_test_home_assistant
                    
17
                    
101
                    
102class TestAlexa(unittest.TestCase):
                    
103    """ Test Alexa. """
                    
211                                                  {}).get('text')
                    
212        self.assertEqual('You told us your sign is .', text)
                    
213
                    
322        self.assertEqual(200, req.status_code)
                    
323        self.assertEqual('', req.text)
                    
324
                    
                
test_search.py https://gitlab.com/jonnialva90/iridium-browser | Python | 387 lines
                    
4
                    
5from tests.compat import mock, unittest
                    
6from httpretty import HTTPretty
                    
7
                    
8import json
                    
9
                    
19
                    
20class CloudSearchSearchBaseTest(unittest.TestCase):
                    
21
                    
184
                    
185        self.assertEqual(args[b'facet.author'], [b'{"sort": "alpha"}'])
                    
186        self.assertEqual(args[b'facet.cat'], [b'{"sort": "count"}'])
                    
374            self.assertTrue('Unknown error' in str(cm.exception))
                    
375            self.assertTrue('went wrong. Oops' in str(cm.exception))
                    
376
                    
                
test_preferences.py https://gitlab.com/khushbuparakh/mailman | Python | 94 lines
                    
19
                    
20import unittest
                    
21
                    
24from mailman.interfaces.preferences import IPreferences
                    
25from mailman.model.preferences import Preferences
                    
26from mailman.testing.layers import ConfigLayer
                    
31
                    
32class TestPreferences(unittest.TestCase):
                    
33    """Test preferences."""
                    
56        # to update this test!
                    
57        self.assertEqual(sorted(attributes), sorted(values))
                    
58        preferences_1 = Preferences()
                    
63        for name, value in values.items():
                    
64            self.assertEqual(getattr(preferences_2, name), value)
                    
65
                    
                
filter_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 256 lines
                    
24
                    
25import unittest
                    
26
                    
51
                    
52class ValidateFilterRulesTest(unittest.TestCase):
                    
53
                    
82
                    
83class CategoryFilterTest(unittest.TestCase):
                    
84
                    
110        # __eq__() and __ne__().
                    
111        self.assertTrue(filter1.__eq__(filter2))
                    
112        self.assertFalse(filter1.__eq__(filter3))
                    
144
                    
145class FilterConfigurationTest(unittest.TestCase):
                    
146
                    
                
test_skipping.py https://gitlab.com/unofficial-mirrors/cpython | Python | 260 lines
                    
48        self.assertEqual(msg, "skip 1")
                    
49        self.assertIsInstance(subtest, unittest.TestCase)
                    
50        self.assertIsNot(subtest, test)
                    
52        self.assertEqual(msg, "skip 2")
                    
53        self.assertIsInstance(subtest, unittest.TestCase)
                    
54        self.assertIsNot(subtest, test)
                    
138    def test_expected_failure_with_wrapped_subclass(self):
                    
139        class Foo(unittest.TestCase):
                    
140            def test_1(self):
                    
181    def test_unexpected_success(self):
                    
182        class Foo(unittest.TestCase):
                    
183            @unittest.expectedFailure
                    
245
                    
246        class Foo(unittest.TestCase):
                    
247            @decorator
                    
                
stubs_test.py https://gitlab.com/gregtyka/frankenserver | Python | 314 lines
                    
20
                    
21import errno
                    
22import locale
                    
22import locale
                    
23import mimetypes
                    
24import os
                    
28import tempfile
                    
29import unittest
                    
30
                    
38
                    
39class StubsTest(unittest.TestCase):
                    
40
                    
166
                    
167class FakeFileTest(unittest.TestCase):
                    
168
                    
                
test_hyperparser.py https://gitlab.com/unofficial-mirrors/cpython | Python | 274 lines
                    
1"""Unittest for idlelib.hyperparser.py."""
                    
2import unittest
                    
3from test.support import requires
                    
3from test.support import requires
                    
4from tkinter import Tk, Text
                    
5from idlelib.editor import EditorWindow
                    
5from idlelib.editor import EditorWindow
                    
6from idlelib.hyperparser import HyperParser
                    
7
                    
19
                    
20class HyperParserTest(unittest.TestCase):
                    
21    code = (
                    
230        self.assertFalse(is_valid_id('for'))
                    
231        self.assertFalse(is_valid_id('import'))
                    
232        self.assertFalse(is_valid_id('return'))
                    
                
test_module.py https://gitlab.com/unofficial-mirrors/cpython | Python | 244 lines
                    
1# Test the module type
                    
2import unittest
                    
3import weakref
                    
3import weakref
                    
4from test.support import gc_collect, requires_type_collecting
                    
5from test.support.script_helper import assert_python_ok
                    
6
                    
7import sys
                    
8ModuleType = type(sys)
                    
18
                    
19class ModuleTests(unittest.TestCase):
                    
20    def test_uninitialized(self):
                    
23        foo = ModuleType.__new__(ModuleType)
                    
24        self.assertTrue(foo.__dict__ is None)
                    
25        self.assertRaises(SystemError, dir, foo)
                    
                
test_event.py https://gitlab.com/mkerfoot/home-assistant | Python | 336 lines
                    
8# pylint: disable=too-few-public-methods
                    
9import unittest
                    
10from datetime import datetime, timedelta
                    
11
                    
12from astral import Astral
                    
13
                    
13
                    
14import homeassistant.core as ha
                    
15from homeassistant.helpers.event import (
                    
23)
                    
24from homeassistant.components import sun
                    
25import homeassistant.util.dt as dt_util
                    
29
                    
30class TestEventHelpers(unittest.TestCase):
                    
31    """
                    
                
test_pyotrs_responses.py https://gitlab.com/rhab/PyOTRS | Python | 189 lines
                    
8# make sure (early) that parent dir (main app) is in path
                    
9import unittest2 as unittest
                    
10import responses  # noqa
                    
15from pyotrs.lib import Client  # noqa
                    
16from pyotrs.lib import APIError  # noqa
                    
17
                    
18
                    
19class FullResponsesTests(unittest.TestCase):
                    
20    """Tests using the responses module"""
                    
42    #     self.assertEqual(obj._result_status_code, 200)
                    
43    #     self.assertDictEqual(obj.result_json,
                    
44    #                          {u'AccessToken': u'tMtTFDg1PxCX51dWnjue4W5oQtNsFd0k'})
                    
51    #
                    
52    #     self.assertIsNone(obj.result_json)
                    
53    #     self.assertIsNone(obj.session_id_store.value)
                    
                
live_client_test.py https://gitlab.com/karambir/gdata | Python | 160 lines
                    
24
                    
25import unittest
                    
26import gdata.blogger.client
                    
28import gdata.gauth
                    
29import gdata.client
                    
30import atom.http_core
                    
33import gdata.data
                    
34import gdata.test_config as conf
                    
35
                    
39
                    
40class BloggerClientTest(unittest.TestCase):
                    
41
                    
72    self.assertEqual(updated.title.text, 'Edited')
                    
73    self.assert_(isinstance(updated, gdata.blogger.data.BlogPost))
                    
74    self.assertEqual(updated.content.text, created.content.text)
                    
                
data_test.py https://gitlab.com/karambir/gdata | Python | 132 lines
                    
22
                    
23import unittest
                    
24import atom.core
                    
29
                    
30class CustomerIdEntryTest(unittest.TestCase):
                    
31
                    
45
                    
46class OrgUnitEntryTest(unittest.TestCase):
                    
47
                    
74         'C123A456B/testOrgUnit92'))
                    
75    self.assertEquals(self.feed.entry[0].org_unit_description, 'test92')
                    
76    self.assertEquals(self.feed.entry[0].org_unit_name, 'testOrgUnit92')
                    
90
                    
91class OrgUserEntryTest(unittest.TestCase):
                    
92
                    
                
model_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 147 lines
                    
9import model
                    
10import unittest
                    
11
                    
11
                    
12class ModelTest(unittest.TestCase):
                    
13  def setUp(self):
                    
44  def testNamespaces(self):
                    
45    self.assertEquals(6, len(self.model.namespaces))
                    
46    self.assertTrue(self.permissions)
                    
67    integer_prop = self.tabs.types['Tab'].properties['id']
                    
68    self.assertEquals(model.PropertyType.INTEGER,
                    
69                      integer_prop.type_.property_type)
                    
72                      array_prop.type_.property_type)
                    
73    self.assertEquals(model.PropertyType.REF,
                    
74                      array_prop.type_.item_type.property_type)
                    
                
test_reporters_message.py https://gitlab.com/murder187ss/buildbot | Python | 112 lines
                    
17from twisted.internet import defer
                    
18from twisted.trial import unittest
                    
19
                    
20from buildbot.process.results import FAILURE
                    
21from buildbot.process.results import SUCCESS
                    
22from buildbot.reporters import message
                    
22from buildbot.reporters import message
                    
23from buildbot.reporters import utils
                    
24from buildbot.test.fake import fakedb
                    
24from buildbot.test.fake import fakedb
                    
25from buildbot.test.fake import fakemaster
                    
26
                    
27
                    
28class TestMessage(unittest.TestCase):
                    
29
                    
                
test_roster.py https://gitlab.com/noc0lour/mailman | Python | 227 lines
                    
19
                    
20import unittest
                    
21
                    
21
                    
22from mailman.app.lifecycle import create_list
                    
23from mailman.interfaces.address import IAddress
                    
31
                    
32class TestMailingListRoster(unittest.TestCase):
                    
33    """Test various aspects of a mailing list's roster."""
                    
123
                    
124class TestMembershipsRoster(unittest.TestCase):
                    
125    """Test the memberships roster."""
                    
200
                    
201class TestUserRoster(unittest.TestCase):
                    
202    """Test aspects of rosters when users are subscribed."""
                    
                
test_funcattrs.py https://gitlab.com/unofficial-mirrors/cpython | Python | 377 lines
                    
1import types
                    
2import unittest
                    
3
                    
17
                    
18class FuncAttrsTest(unittest.TestCase):
                    
19    def setUp(self):
                    
325
                    
326class CellTest(unittest.TestCase):
                    
327    def test_comparison(self):
                    
338
                    
339class StaticMethodAttrsTest(unittest.TestCase):
                    
340    def test_func_attribute(self):
                    
350
                    
351class BuiltinFunctionPropertiesTest(unittest.TestCase):
                    
352    # XXX Not sure where this should really go since I can't find a
                    
                
test_paginate.py https://gitlab.com/khushbuparakh/mailman | Python | 127 lines
                    
19
                    
20import unittest
                    
21
                    
24from mailman.database.transaction import transaction
                    
25from mailman.rest.helpers import CollectionMixin
                    
26from mailman.testing.layers import RESTLayer
                    
37
                    
38class TestPaginateHelper(unittest.TestCase):
                    
39    """Test the @paginate decorator."""
                    
72        self.assertEqual(page['total_size'], 5)
                    
73        self.assertEqual(
                    
74            [entry['value'] for entry in page['entries']], ['one', 'two'])
                    
113        resource = self._get_resource()
                    
114        self.assertRaises(HTTPInvalidParam, resource._make_collection,
                    
115                          _FakeRequest(-1, 1))
                    
                
test_corpora.py https://gitlab.com/pierreEffiScience/TwitterClustering | Python | 330 lines
                    
10
                    
11import logging
                    
12import os.path
                    
12import os.path
                    
13import unittest
                    
14import tempfile
                    
14import tempfile
                    
15import itertools
                    
16
                    
16
                    
17import numpy
                    
18
                    
44
                    
45class CorpusTestCase(unittest.TestCase):
                    
46    TEST_CORPUS = [[(1, 1.0)], [], [(0, 0.5), (2, 1.0)], []]
                    
                
bisect_results_test.py https://gitlab.com/jonnialva90/iridium-browser | Python | 283 lines
                    
5import os
                    
6import unittest
                    
7
                    
54
                    
55class BisectResultsTest(unittest.TestCase):
                    
56
                    
90    confidence = BisectResults.ConfidenceScore(bad_values, good_values)
                    
91    self.assertEqual(score, confidence)
                    
92
                    
209                            self.mock_opts, self.mock_warnings)
                    
210    self.assertIsNone(results.first_working_revision)
                    
211    self.assertEqual(revision_states[4], results.last_broken_revision)
                    
282if __name__ == '__main__':
                    
283  unittest.main()
                    
284
                    
                
test_devpoll.py https://gitlab.com/unofficial-mirrors/cpython | Python | 145 lines
                    
7import select
                    
8import unittest
                    
9from test.support import run_unittest, cpython_only
                    
11if not hasattr(select, 'devpoll') :
                    
12    raise unittest.SkipTest('test works only on Solaris OS family')
                    
13
                    
21
                    
22class DevPollTests(unittest.TestCase):
                    
23
                    
97        # test fileno() method and closed attribute
                    
98        self.assertIsInstance(devpoll.fileno(), int)
                    
99        self.assertFalse(devpoll.closed)
                    
102        devpoll.close()
                    
103        self.assertTrue(devpoll.closed)
                    
104        self.assertRaises(ValueError, devpoll.fileno)
                    
                
test_koWindowsIntegration.py https://gitlab.com/Smileyt/KomodoEdit | Python | 247 lines
                    
4import inspect, imp, sys
                    
5import unittest, testlib
                    
6import logging
                    
9if sys.platform.startswith("win"):
                    
10    class TestKoWindowsIntegrationService(unittest.TestCase):
                    
11        def __init__(self, methodName):
                    
12            unittest.TestCase.__init__(self, methodName)
                    
13            self.real_import = __builtins__["__import__"]
                    
14            self.winIntegSvc = None
                    
27            self.fakeWinReg.elevated = False
                    
28            __builtins__["__import__"] = self.fake_import
                    
29
                    
32                return
                    
33            __builtins__["__import__"] = self.real_import
                    
34            self.winIntegSvc = None
                    
                
test_functions.py https://gitlab.com/unofficial-mirrors/cpython | Python | 402 lines
                    
7
                    
8from ctypes import *
                    
9from ctypes.test import need_symbol
                    
9from ctypes.test import need_symbol
                    
10import sys, unittest
                    
11
                    
17
                    
18import _ctypes_test
                    
19dll = CDLL(_ctypes_test.__file__)
                    
27                ("right", c_int), ("bottom", c_int)]
                    
28class FunctionTestCase(unittest.TestCase):
                    
29
                    
45
                    
46        from _ctypes import _Pointer
                    
47        try:
                    
                
test_dict_version.py https://gitlab.com/unofficial-mirrors/cpython | Python | 186 lines
                    
3"""
                    
4import unittest
                    
5from test import support
                    
8# don't require to implement it
                    
9_testcapi = support.import_module('_testcapi')
                    
10
                    
11
                    
12class DictVersionTests(unittest.TestCase):
                    
13    type2test = dict
                    
20        version = _testcapi.dict_get_version(mydict)
                    
21        self.assertNotIn(version, self.seen_versions)
                    
22        self.seen_versions.add(version)
                    
35        version2 = _testcapi.dict_get_version(mydict)
                    
36        self.assertEqual(version2, version1, "version changed")
                    
37
                    
                
test_abc.py git://github.com/IronLanguages/main.git | Python | 236 lines
                    
5
                    
6import unittest, weakref
                    
7from test import test_support
                    
8
                    
9import abc
                    
10from inspect import isabstract
                    
11
                    
12import sys
                    
13
                    
14
                    
15class TestABC(unittest.TestCase):
                    
16
                    
19        def foo(self): pass
                    
20        self.assertTrue(foo.__isabstractmethod__)
                    
21        def bar(self): pass
                    
                
testkit.py https://gitlab.com/samba/webapptitude | Python | 282 lines
                    
1
                    
2import unittest
                    
3import traceback
                    
7import cStringIO
                    
8import base64
                    
9
                    
15import webob
                    
16import webapp2
                    
17import webtest
                    
17import webtest
                    
18import logging
                    
19import contextlib
                    
135
                    
136class TestCase(unittest.TestCase):
                    
137    logger = logger
                    
                
intbase.py https://pykd.svn.codeplex.com/svn | Python | 173 lines
                    
1
                    
2import unittest
                    
3import target
                    
3import target
                    
4from pykd import intBase
                    
5
                    
5
                    
6class IntBaseTest( unittest.TestCase ):
                    
7
                    
21    def testEq( self ):
                    
22        self.assertTrue( 0xFF == intBase(0xFF) and intBase(0xFF) == 0xFF )
                    
23        self.assertTrue( 0xFFFF == intBase(0xFFFF) and 0xFFFF == intBase(0xFFFF) )
                    
23        self.assertTrue( 0xFFFF == intBase(0xFFFF) and 0xFFFF == intBase(0xFFFF) )
                    
24        self.assertTrue( 0xFFFFFFFF ==  intBase(0xFFFFFFFF) and  intBase(0xFFFFFFFF) == 0xFFFFFFFF )
                    
25        self.assertTrue( 0x8000000000000000 == intBase(0x8000000000000000) )
                    
                
test_remoting.py https://gitlab.com/gregtyka/frankenserver | Python | 390 lines
                    
11
                    
12import unittest
                    
13
                    
17
                    
18class DecoderTestCase(unittest.TestCase):
                    
19    """
                    
184
                    
185class EncoderTestCase(unittest.TestCase):
                    
186    """
                    
307
                    
308class StrictEncodingTestCase(unittest.TestCase):
                    
309    def test_request(self):
                    
327
                    
328class FaultTestCase(unittest.TestCase):
                    
329    def test_exception(self):
                    
                
test_int_literal.py https://IronPython.svn.codeplex.com/svn | Python | 192 lines
                    
5
                    
6import unittest
                    
7from test import test_support
                    
8
                    
9import warnings
                    
10warnings.filterwarnings("ignore", "hex/oct constants", FutureWarning,
                    
12
                    
13class TestHexOctBin(unittest.TestCase):
                    
14
                    
16        # A few upper/lowercase tests
                    
17        self.assertEqual(0x0, 0X0)
                    
18        self.assertEqual(0x1, 0X1)
                    
18        self.assertEqual(0x1, 0X1)
                    
19        self.assertEqual(0x123456789abcdef, 0X123456789abcdef)
                    
20        # Baseline tests
                    
                
test_archive_util.py https://gitlab.com/atom-k/android-plus-plus | Python | 328 lines
                    
4
                    
5import unittest
                    
6import os
                    
6import os
                    
7import sys
                    
8import tarfile
                    
8import tarfile
                    
9from os.path import splitdrive
                    
10import warnings
                    
16from distutils.tests import support
                    
17from test.test_support import check_warnings, run_unittest
                    
18
                    
52                          support.LoggingSilencer,
                    
53                          unittest.TestCase):
                    
54
                    
                
service_test.py https://gitlab.com/karambir/gdata | Python | 272 lines
                    
20import re
                    
21import unittest
                    
22import urllib
                    
30
                    
31class ContactsServiceTest(unittest.TestCase):
                    
32
                    
197
                    
198class ContactsQueryTest(unittest.TestCase):
                    
199
                    
220
                    
221class ContactsGroupsTest(unittest.TestCase):
                    
222
                    
263def suite():
                    
264  return unittest.TestSuite((unittest.makeSuite(ContactsServiceTest, 'test'),
                    
265                             unittest.makeSuite(ContactsQueryTest, 'test'),
                    
                
test_volume.py https://gitlab.com/jonnialva90/iridium-browser | Python | 268 lines
                    
1from tests.compat import mock, unittest
                    
2
                    
7
                    
8class VolumeTests(unittest.TestCase):
                    
9    def setUp(self):
                    
122        retval = self.volume_one.update()
                    
123        self.assertEqual(retval, "two_status")
                    
124
                    
188        retval = self.volume_two.attachment_state()
                    
189        self.assertEqual(retval, None)
                    
190
                    
209
                    
210class AttachmentSetTests(unittest.TestCase):
                    
211    def check_that_attribute_has_been_set(self, name, value, attribute):
                    
234
                    
235class VolumeAttributeTests(unittest.TestCase):
                    
236    def setUp(self):
                    
                
tests.py https://gitlab.com/goolic/pyramid | Python | 123 lines
                    
1import unittest
                    
2
                    
4
                    
5class PageModelTests(unittest.TestCase):
                    
6
                    
17
                    
18class WikiModelTests(unittest.TestCase):
                    
19
                    
31
                    
32class AppmakerTests(unittest.TestCase):
                    
33
                    
77
                    
78class AddPageTests(unittest.TestCase):
                    
79    def _callFUT(self, context, request):
                    
103
                    
104class EditPageTests(unittest.TestCase):
                    
105    def _callFUT(self, context, request):
                    
                
test_archive_util.py https://gitlab.com/unofficial-mirrors/cpython | Python | 395 lines
                    
2"""Tests for distutils.archive_util."""
                    
3import unittest
                    
4import os
                    
4import os
                    
5import sys
                    
6import tarfile
                    
6import tarfile
                    
7from os.path import splitdrive
                    
8import warnings
                    
15from distutils.tests import support
                    
16from test.support import check_warnings, run_unittest, patch, change_cwd
                    
17
                    
61                          support.LoggingSilencer,
                    
62                          unittest.TestCase):
                    
63
                    
                
test_response.py https://gitlab.com/durandj/mymcadmin | Python | 480 lines
                    
5import json
                    
6import unittest
                    
7
                    
11
                    
12class TestJsonRpcResponse(unittest.TestCase):
                    
13    """
                    
141
                    
142        self.assertEqual(
                    
143            2,
                    
172
                    
173        self.assertDictEqual(
                    
174            {
                    
341
                    
342class TestJsonRpcBatchResponse(unittest.TestCase):
                    
343    """
                    
                
test_timesince.py https://gitlab.com/asmjahid/django | Python | 119 lines
                    
3import datetime
                    
4import unittest
                    
5
                    
6from django.test.utils import requires_tz_support
                    
7from django.utils import timezone
                    
8from django.utils.timesince import timesince, timeuntil
                    
10
                    
11class TimesinceTests(unittest.TestCase):
                    
12
                    
67        self.assertEqual(timesince(self.t, self.t - self.onehour), '0\xa0minutes')
                    
68        self.assertEqual(timesince(self.t, self.t - self.oneday), '0\xa0minutes')
                    
69        self.assertEqual(timesince(self.t, self.t - self.oneweek), '0\xa0minutes')
                    
114        past = datetime.datetime(1980, 1, 1, tzinfo=naive())
                    
115        self.assertEqual(timeuntil(past), '0\xa0minutes')
                    
116
                    
                
test_winsound.py https://gitlab.com/atom-k/android-plus-plus | Python | 256 lines
                    
2
                    
3import unittest
                    
4from test import test_support
                    
31
                    
32class BeepTest(unittest.TestCase):
                    
33    # As with PlaySoundTest, incorporate the _have_soundcard() check
                    
68
                    
69class MessageBeepTest(unittest.TestCase):
                    
70
                    
94
                    
95class PlaySoundTest(unittest.TestCase):
                    
96
                    
97    def test_errors(self):
                    
98        self.assertRaises(TypeError, winsound.PlaySound)
                    
99        self.assertRaises(TypeError, winsound.PlaySound, "bad", "bad")
                    
                
test_data_changes.py https://gitlab.com/murder187ss/buildbot | Python | 333 lines
                    
18from twisted.internet import task
                    
19from twisted.trial import unittest
                    
20
                    
22from buildbot.data import resultspec
                    
23from buildbot.process.users import users
                    
24from buildbot.test.fake import fakedb
                    
30
                    
31class ChangeEndpoint(endpoint.EndpointMixin, unittest.TestCase):
                    
32
                    
65
                    
66class ChangesEndpoint(endpoint.EndpointMixin, unittest.TestCase):
                    
67
                    
121
                    
122class Change(interfaces.InterfaceTests, unittest.TestCase):
                    
123    changeEvent = {
                    
                
test_uu.py https://gitlab.com/atom-k/android-plus-plus | Python | 201 lines
                    
5
                    
6import unittest
                    
7from test import test_support
                    
19
                    
20class UUTest(unittest.TestCase):
                    
21
                    
61        except uu.Error, e:
                    
62            self.assertEqual(str(e), "No valid begin line found in input file")
                    
63
                    
63
                    
64class UUStdIOTest(unittest.TestCase):
                    
65
                    
88
                    
89class UUFileTest(unittest.TestCase):
                    
90
                    
                
test_break.py https://gitlab.com/unofficial-mirrors/cpython | Python | 291 lines
                    
7
                    
8import unittest
                    
9
                    
14    "if threads have been used")
                    
15class TestBreak(unittest.TestCase):
                    
16    int_handler = None
                    
39
                    
40        self.assertTrue(unittest.signals._interrupt_handler.called)
                    
41
                    
158        result = runner.run(unittest.TestSuite())
                    
159        self.assertIn(result, unittest.signals._results)
                    
160
                    
181        # Should this raise an error instead?
                    
182        self.assertFalse(unittest.removeResult(unittest.TestResult()))
                    
183
                    
                
system_stub_unittest.py https://gitlab.com/jonnialva90/iridium-browser | Python | 251 lines
                    
5import os
                    
6import unittest
                    
7
                    
8PERF_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
                    
9from telemetry.testing import system_stub
                    
10from telemetry.internal.testing import system_stub_test_module
                    
11
                    
12class CloudStorageTest(unittest.TestCase):
                    
13  SUCCESS_FILE_HASH = 'success'.zfill(40)
                    
70  def testSetup(self):
                    
71    self.assertEqual(self.local_file_hashes,
                    
72                     self.cloud_storage.local_file_hashes)
                    
131  def testEmptyInsertAndGet(self):
                    
132    self.assertRaises(self.cloud_storage.NotFoundError, self.cloud_storage.Get,
                    
133                      self.cloud_storage.PUBLIC_BUCKET, 'success.wpr',
                    
                
 

Source

Language