PageRenderTime 386ms queryTime 106ms sortTime 19ms getByIdsTime 74ms findMatchingLines 130ms

100+ results results for '"import unittest" unittest.TestCase self.assert lang:Python' (386 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."""
                    
                
serializer_test.py https://github.com/lann/mopidy.git | Python | 353 lines
                    
8
                    
9from tests import unittest
                    
10
                    
11
                    
12class TrackMpdFormatTest(unittest.TestCase):
                    
13    track = Track(
                    
105
                    
106class PlaylistMpdFormatTest(unittest.TestCase):
                    
107    def test_mpd_format(self):
                    
120
                    
121class TracksToTagCacheFormatTest(unittest.TestCase):
                    
122    def setUp(self):
                    
299
                    
300class TracksToDirectoryTreeTest(unittest.TestCase):
                    
301    def setUp(self):
                    
                
zeyatest.py https://github.com/TheSkorm/zeya.git | Python | 238 lines
                    
25import os
                    
26import unittest
                    
27
                    
58
                    
59class CommonTest(unittest.TestCase):
                    
60    def test_tokenization(self):
                    
145
                    
146class OptionsTest(unittest.TestCase):
                    
147    def test_default(self):
                    
185
                    
186class PlsTest(unittest.TestCase):
                    
187    def test_parse_pls(self):
                    
213
                    
214class RhythmboxTest(unittest.TestCase):
                    
215    def test_read_library(self):
                    
                
test_long_future.py https://github.com/jdhardy/ironpython.git | Python | 221 lines
                    
6import sys
                    
7import random
                    
8import math
                    
8import math
                    
9import unittest
                    
10from test.test_support import run_unittest
                    
52
                    
53class TrueDivisionTests(unittest.TestCase):
                    
54    def test(self):
                    
60        self.assertEqual(mhuge / huge, -1.0)
                    
61        self.assertEqual(1 / huge, 0.0)
                    
62        self.assertEqual(1L / huge, 0.0)
                    
62        self.assertEqual(1L / huge, 0.0)
                    
63        self.assertEqual(1 / mhuge, 0.0)
                    
64        self.assertEqual(1L / mhuge, 0.0)
                    
                
tests.py https://github.com/jezdez/django-old.git | Python | 349 lines
                    
1import copy
                    
2import pickle
                    
3
                    
4from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError,
                    
5        parse_cookie)
                    
5        parse_cookie)
                    
6from django.utils import unittest
                    
7
                    
8
                    
9class QueryDictTests(unittest.TestCase):
                    
10    def test_missing_key(self):
                    
211
                    
212class HttpResponseTests(unittest.TestCase):
                    
213    def test_unicode_headers(self):
                    
298
                    
299class CookieTests(unittest.TestCase):
                    
300    def test_encode(self):
                    
                
test_op.py https://github.com/mrocklin/Theano.git | Python | 341 lines
                    
1from copy import copy
                    
2import unittest
                    
3
                    
5
                    
6import theano
                    
7
                    
7
                    
8import theano.gof.op as op
                    
9from theano.gof.type import Type, Generic
                    
9from theano.gof.type import Type, Generic
                    
10from theano.gof.graph import Apply, Variable
                    
11import theano.tensor as T
                    
102
                    
103class TestMakeThunk(unittest.TestCase):
                    
104    def test_no_c_code(self):
                    
                
test_int_literal.py https://bitbucket.org/glix/python.git | Python | 191 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_dtoc.py https://gitlab.com/gmbnomis/u-boot | Python | 523 lines
                    
14import struct
                    
15import unittest
                    
16
                    
17import dtb_platdata
                    
18from dtb_platdata import conv_name_to_c
                    
19from dtb_platdata import get_compat_name
                    
61
                    
62class TestDtoc(unittest.TestCase):
                    
63    """Tests for dtoc"""
                    
90        """Test operation of get_value() function"""
                    
91        self.assertEqual('0x45',
                    
92                         get_value(fdt.TYPE_INT, struct.pack('>I', 0x45)))
                    
92                         get_value(fdt.TYPE_INT, struct.pack('>I', 0x45)))
                    
93        self.assertEqual('0x45',
                    
94                         get_value(fdt.TYPE_BYTE, struct.pack('<I', 0x45)))
                    
                
test_threadsignals.py https://bitbucket.org/kbengine/kbengine.git | Python | 223 lines
                    
2
                    
3import unittest
                    
4import signal
                    
6import sys
                    
7from test.support import run_unittest, import_module
                    
8thread = import_module('_thread')
                    
40
                    
41class ThreadSignals(unittest.TestCase):
                    
42
                    
66        self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped'], 1)
                    
67        self.assertEqual( signal_blackboard[signal.SIGUSR2]['tripped_by'],
                    
68                           thread.get_ident())
                    
89            t1 = time.time()
                    
90            self.assertRaises(KeyboardInterrupt, lock.acquire, timeout=5)
                    
91            dt = time.time() - t1
                    
                
test_winsound.py https://bitbucket.org/kbengine/kbengine.git | Python | 260 lines
                    
2
                    
3import unittest
                    
4from test import 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")
                    
                
Form.py https://bitbucket.org/pefarrell/dolfin.git | Python | 439 lines
                    
24
                    
25import unittest
                    
26import numpy
                    
29
                    
30class FormTest(unittest.TestCase):
                    
31
                    
52
                    
53class FormTestsOverManifolds(unittest.TestCase):
                    
54
                    
186
                    
187class FormTestsOverFunnySpaces(unittest.TestCase):
                    
188
                    
286
                    
287class TestGeometricQuantitiesOverManifolds(unittest.TestCase):
                    
288
                    
                
executive_unittest.py https://gitlab.com/brian0218/rk3188_r-box_android4.2.2_sdk | Python | 201 lines
                    
33import sys
                    
34import unittest
                    
35
                    
40
                    
41class ScriptErrorTest(unittest.TestCase):
                    
42    def test_string_from_args(self):
                    
66
                    
67class ExecutiveTest(unittest.TestCase):
                    
68
                    
87        self.assert_interpreter_for_content('perl', '#!/usr/bin/perl')
                    
88        self.assert_interpreter_for_content('perl', '#!/usr/bin/perl -w')
                    
89        self.assert_interpreter_for_content(sys.executable, '#!/usr/bin/env python')
                    
198        executive = Executive()
                    
199        self.assertTrue(executive.check_running_pid(os.getpid()))
                    
200        # Maximum pid number on Linux is 32768 by default
                    
                
test_variables.py https://gitlab.com/abhi1tb/build | Python | 310 lines
                    
1import unittest
                    
2import gc
                    
2import gc
                    
3from tkinter import (Variable, StringVar, IntVar, DoubleVar, BooleanVar, Tcl,
                    
4                     TclError)
                    
16
                    
17class TestBase(unittest.TestCase):
                    
18
                    
32        v = Variable(self.root)
                    
33        self.assertEqual("", v.get())
                    
34        self.assertRegex(str(v), r"^PY_VAR(\d+)$")
                    
37        v = Variable(self.root, "sample string", "varname")
                    
38        self.assertEqual("sample string", v.get())
                    
39        self.assertEqual("varname", str(v))
                    
308if __name__ == "__main__":
                    
309    from test.support import run_unittest
                    
310    run_unittest(*tests_gui)
                    
                
PRESUBMIT_test.py https://github.com/chromium/chromium.git | Python | 231 lines
                    
7import sys
                    
8import unittest
                    
9
                    
16
                    
17class CheckNotificationConstructors(unittest.TestCase):
                    
18  """Test the _CheckNotificationConstructors presubmit check."""
                    
59
                    
60class CheckAlertDialogBuilder(unittest.TestCase):
                    
61  """Test the _CheckAlertDialogBuilder presubmit check."""
                    
125
                    
126class CheckCompatibleAlertDialogBuilder(unittest.TestCase):
                    
127  """Test the _CheckCompatibleAlertDialogBuilder presubmit check."""
                    
178
                    
179class CheckBundleUtilsIdentifierName(unittest.TestCase):
                    
180  """Test the _CheckBundleUtilsIdentifierName presubmit check."""
                    
                
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)
                    
                
Configuration_t.py https://github.com/PerilousApricot/WMCore.git | Python | 286 lines
                    
4
                    
5import unittest
                    
6import os
                    
9from WMCore.Configuration import Configuration
                    
10from WMCore.Configuration import loadConfigurationFile
                    
11from WMCore.Configuration import saveConfigurationFile
                    
15
                    
16class ConfigurationTest(unittest.TestCase):
                    
17    """
                    
84                         config.Section1.Parameter1)
                    
85        self.assertEqual(section1Dict['Parameter2'],
                    
86                         config.Section1.Parameter2)
                    
280        for values in d.values():
                    
281            self.assertFalse(isinstance(values, ConfigSection))
                    
282        self.assertEqual(d["Task1"]["subSection"]["value3"], "MyValue3")
                    
                
mock_http_core_test.py https://github.com/kaosbeat/MK10-koerssoftware.git | Python | 198 lines
                    
24
                    
25import unittest
                    
26import StringIO
                    
26import StringIO
                    
27import os.path
                    
28import atom.mock_http_core
                    
31
                    
32class EchoClientTest(unittest.TestCase):
                    
33  
                    
93
                    
94class MockHttpClientTest(unittest.TestCase):
                    
95
                    
192def suite():
                    
193  return unittest.TestSuite((unittest.makeSuite(MockHttpClientTest, 'test'),
                    
194                             unittest.makeSuite(EchoClientTest, 'test')))
                    
                
input_stream_test.py https://bitbucket.org/Abd4llA/test.git | Python | 293 lines
                    
34
                    
35import unittest
                    
36from google.protobuf import message
                    
36from google.protobuf import message
                    
37from google.protobuf.internal import wire_format
                    
38from google.protobuf.internal import input_stream
                    
40
                    
41class InputStreamTest(unittest.TestCase):
                    
42
                    
44    stream = input_stream.InputStream('abcd')
                    
45    self.assertFalse(stream.EndOfStream())
                    
46    self.assertEqual('abcd', stream.ReadBytes(10))
                    
46    self.assertEqual('abcd', stream.ReadBytes(10))
                    
47    self.assertTrue(stream.EndOfStream())
                    
48
                    
                
test_repr.py https://bitbucket.org/glix/python.git | Python | 327 lines
                    
8import shutil
                    
9import unittest
                    
10
                    
10
                    
11from test.test_support import run_unittest
                    
12from repr import repr as r # Don't shadow builtin repr
                    
21
                    
22class ReprTests(unittest.TestCase):
                    
23
                    
132        self.failUnless(repr(fp).startswith(
                    
133            "<open file '%s', mode 'r' at 0x" % unittest.__file__))
                    
134        fp.close()
                    
213
                    
214class LongReprTest(unittest.TestCase):
                    
215    def setUp(self):
                    
                
lang.py https://github.com/dax/jmc.git | Python | 219 lines
                    
23
                    
24import unittest
                    
25
                    
25
                    
26import jcl.tests.lang
                    
27
                    
27
                    
28import jmc.lang
                    
29from jmc.lang import Lang
                    
30
                    
31from pyxmpp.iq import Iq
                    
32
                    
32
                    
33class Lang_TestCase(unittest.TestCase):
                    
34    def setUp(self):
                    
                
test_recipients.py https://gitlab.com/noc0lour/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_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_heapq.py https://github.com/thepian/pypy.git | Python | 286 lines
                    
4import random
                    
5import unittest
                    
6from test import test_support
                    
6from test import test_support
                    
7import sys
                    
8
                    
17
                    
18class TestHeap(unittest.TestCase):
                    
19
                    
118                self.assertEqual(nlargest(n, data), sorted(data, reverse=True)[:n])
                    
119                self.assertEqual(nlargest(n, data, key=f),
                    
120                                 sorted(data, key=f, reverse=True)[:n])
                    
216
                    
217class TestErrorHandling(unittest.TestCase):
                    
218
                    
                
test_shell.py https://github.com/homocury/mongo.git | Python | 239 lines
                    
23
                    
24import unittest
                    
25import sys
                    
25import sys
                    
26import subprocess
                    
27import os
                    
35
                    
36class TestShell(unittest.TestCase):
                    
37
                    
53        out = mongo_h.communicate()
                    
54        self.assertEqual(out, mongo_help.communicate())
                    
55        self.assert_("usage:" in out[0])
                    
56
                    
57        self.assertEqual(0, mongo_h.returncode)
                    
58        self.assertEqual(0, mongo_help.returncode)
                    
                
tests.py https://bitbucket.org/zozo123/fuzzywuzzy.git | Python | 285 lines
                    
7import itertools
                    
8import unittest
                    
9
                    
9
                    
10class UtilsTest(unittest.TestCase):
                    
11    def setUp(self):
                    
46
                    
47class RatioTest(unittest.TestCase):
                    
48
                    
171
                    
172class ProcessTest(unittest.TestCase):
                    
173
                    
247        self.assertTrue(best is None)
                    
248        #self.assertIsNone(best) # unittest.TestCase did not have assertIsNone until Python 2.7
                    
249
                    
                
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_reprlib.py https://bitbucket.org/kbengine/kbengine.git | Python | 340 lines
                    
8import shutil
                    
9import unittest
                    
10
                    
10
                    
11from test.support import run_unittest
                    
12from reprlib import repr as r # Don't shadow builtin repr
                    
22
                    
23class ReprTests(unittest.TestCase):
                    
24
                    
200
                    
201class LongReprTest(unittest.TestCase):
                    
202    def setUp(self):
                    
319
                    
320class TestRecursiveRepr(unittest.TestCase):
                    
321    def test_recursive_repr(self):
                    
                
testArray.py https://github.com/WeatherGod/numpy.git | Python | 284 lines
                    
1#! /usr/bin/env python
                    
2from __future__ import division, absolute_import, print_function
                    
3
                    
7import sys
                    
8import unittest
                    
9
                    
21
                    
22class Array1TestCase(unittest.TestCase):
                    
23
                    
95        "Test Array1 __getitem__ method, negative index"
                    
96        self.assertRaises(IndexError, self.array1.__getitem__, -1)
                    
97
                    
121
                    
122class Array2TestCase(unittest.TestCase):
                    
123
                    
                
test_genericpath.py https://gitlab.com/envieidoc/Clover | Python | 256 lines
                    
4
                    
5import unittest
                    
6from test import test_support
                    
6from test import test_support
                    
7import os
                    
8import genericpath
                    
8import genericpath
                    
9import sys
                    
10
                    
18
                    
19class GenericTest(unittest.TestCase):
                    
20    # The path module to be tested
                    
27        for attr in self.common_attributes + self.attributes:
                    
28            with self.assertRaises(TypeError):
                    
29                getattr(self.pathmodule, attr)()
                    
                
test_traceback.py https://gitlab.com/envieidoc/Clover | Python | 204 lines
                    
5import sys
                    
6import unittest
                    
7from imp import reload
                    
7from imp import reload
                    
8from test.test_support import run_unittest, is_jython, Error
                    
9
                    
12
                    
13class TracebackCases(unittest.TestCase):
                    
14    # For now, a very minimal set of tests.  I want to be sure that
                    
65        self.assertTrue(err[1].strip() == "print 2")
                    
66        self.assertIn("^", err[2])
                    
67        self.assertTrue(err[1].find("2") == err[2].find("^"))
                    
171
                    
172class TracebackFormatTests(unittest.TestCase):
                    
173
                    
                
tests.py https://bitbucket.org/ducopdep/tiny_blog.git | Python | 286 lines
                    
1from __future__ import absolute_import
                    
2
                    
2
                    
3from datetime import datetime
                    
4
                    
4
                    
5from django.conf import settings
                    
6from django.contrib import admin
                    
6from django.contrib import admin
                    
7from django.contrib.admin import helpers
                    
8from django.contrib.admin.util import (display_for_field, label_for_field,
                    
14from django.test import TestCase
                    
15from django.utils import unittest
                    
16from django.utils.formats import localize
                    
72
                    
73class UtilTests(unittest.TestCase):
                    
74    def test_values_from_lookup_field(self):
                    
                
base.py https://github.com/rabbitmq/rabbitmq-stomp.git | Python | 259 lines
                    
7
                    
8import unittest
                    
9import stomp
                    
10import sys
                    
11import threading
                    
12import os
                    
14
                    
15class BaseTest(unittest.TestCase):
                    
16
                    
98       listener.wait()
                    
99       self.assertEquals(1, len(listener.receipts))
                    
100       listener.reset()
                    
104        # Note: useful for debugging
                    
105        # import stomp.listener
                    
106        self.conn = self.create_connection()
                    
                
test_platform.py https://gitlab.com/pmuontains/Odoo | Python | 267 lines
                    
2import os
                    
3import unittest
                    
4import platform
                    
4import platform
                    
5import subprocess
                    
6
                    
8
                    
9class PlatformTest(unittest.TestCase):
                    
10    def test_architecture(self):
                    
140        res = platform.uname()
                    
141        self.assertTrue(any(res))
                    
142
                    
233    def test_libc_ver(self):
                    
234        import os
                    
235        if os.path.isdir(sys.executable) and \
                    
                
test_routes.py https://github.com/archanmishra/pyramid.git | Python | 223 lines
                    
1import unittest
                    
2
                    
2
                    
3from pyramid.tests.test_config import dummyfactory
                    
4from pyramid.tests.test_config import DummyContext
                    
5
                    
6class RoutesConfiguratorMixinTests(unittest.TestCase):
                    
7    def _makeOne(self, *arg, **kw):
                    
12    def _assertRoute(self, config, name, path, num_predicates=0):
                    
13        from pyramid.interfaces import IRoutesMapper
                    
14        mapper = config.registry.getUtility(IRoutesMapper)
                    
85        request.is_xhr = True
                    
86        self.assertEqual(predicate(None, request), True)
                    
87        request = self._makeRequest(config)
                    
88        request.is_xhr = False
                    
89        self.assertEqual(predicate(None, request), False)
                    
90
                    
                
api.py https://github.com/mikkorantalainen/trac.git | Python | 347 lines
                    
3import os
                    
4import unittest
                    
5
                    
25
                    
26class WithTransactionTest(unittest.TestCase):
                    
27
                    
199
                    
200class ParseConnectionStringTestCase(unittest.TestCase):
                    
201
                    
262
                    
263class StringsTestCase(unittest.TestCase):
                    
264
                    
300
                    
301class ConnectionTestCase(unittest.TestCase):
                    
302    def setUp(self):
                    
                
test_bus.py https://github.com/theosp/google_appengine.git | 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_request_pool.py https://gitlab.com/gbozee/api-gateway-client | Python | 270 lines
                    
1# from . import unittest
                    
2# from . import mock
                    
164
                    
165#         self.assertEqual(self.service.client, self.schema)
                    
166
                    
182#         self.assertEqual(self.service.fields, self.fields)
                    
183#         self.assertEqual(result[0]['req_id'], 28)
                    
184
                    
190#         self.assertEqual(result['pk'], 23)
                    
191#         self.assertEqual(result['tutor_slug'], "johndoe")
                    
192
                    
212
                    
213# class LocalMatchingServiceTestCase(BaseTestCase, unittest.TestCase):
                    
214#     def setUp(self):
                    
224
                    
225# class RemoteMatchingServiceTestCase(BaseTestCase, unittest.TestCase):
                    
226#     def setUp(self):
                    
                
test_lockfile.py https://github.com/jcrobak/hue.git | Python | 422 lines
                    
10
                    
11from twisted.trial import unittest
                    
12from twisted.python import lockfile
                    
14
                    
15class UtilTests(unittest.TestCase):
                    
16    """
                    
100
                    
101class LockingTestCase(unittest.TestCase):
                    
102    def _symlinkErrorTest(self, errno):
                    
174        self.assertFalse(secondLock.lock())
                    
175        self.assertFalse(secondLock.locked)
                    
176
                    
407        lock = lockfile.FilesystemLock(lockf)
                    
408        self.assertRaises(ValueError, lock.unlock)
                    
409
                    
                
test_module_validate.py https://gitlab.com/exarh-team/skaro-server | Python | 432 lines
                    
19
                    
20import unittest
                    
21from modules import validate
                    
24
                    
25class ValidateTestCase(unittest.TestCase):
                    
26
                    
27    def test_is_valid(self):
                    
28        self.assertTrue(
                    
29            validate.is_valid("login", validate.P_LOGIN)
                    
60
                    
61        self.assertTrue(
                    
62            validate.is_valid("200 OK", validate.P_STATUS)
                    
371        def test_exception_dict(a, info=False):
                    
372            self.assertCountEqual(
                    
373                info,
                    
                
test_commands.py https://gitlab.com/github-cloud-corp/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
                    
                
test_player.py https://github.com/pv/pelita.git | Python | 196 lines
                    
1import unittest
                    
2from pelita.player import *
                    
2from pelita.player import *
                    
3from pelita.datamodel import create_CTFUniverse, north, stop, east
                    
4from pelita.game_master import GameMaster
                    
6
                    
7class TestAbstractPlayer(unittest.TestCase):
                    
8
                    
69
                    
70class TestNQRandom_Player(unittest.TestCase):
                    
71    def test_demo_players(self):
                    
82
                    
83class TestBFS_Player(unittest.TestCase):
                    
84
                    
139
                    
140class TestSimpleTeam(unittest.TestCase):
                    
141
                    
                
test_origin.py https://github.com/smballe/sos.git | Python | 213 lines
                    
16try:
                    
17    import simplejson as json
                    
18except ImportError:
                    
19    import json
                    
20import unittest
                    
21#from contextlib import contextmanager
                    
93
                    
94class TestOrigin(unittest.TestCase):
                    
95
                    
121            ).get_response(self.test_origin)
                    
122        self.assertEquals(resp.status_int, 404)
                    
123
                    
212if __name__ == '__main__':
                    
213    unittest.main()
                    
214
                    
                
test_notifications.py https://gitlab.com/mmhat/mailman | Python | 317 lines
                    
21import os
                    
22import unittest
                    
23
                    
26from mailman.config import config
                    
27from mailman.interfaces.languages import ILanguageManager
                    
28from mailman.interfaces.member import MemberRole
                    
39
                    
40class TestNotifications(unittest.TestCase):
                    
41    """Test notifications."""
                    
124        message = items[0].msg
                    
125        self.assertEqual(str(message['subject']),
                    
126                         'Welcome to the "Test List" mailing list')
                    
126                         'Welcome to the "Test List" mailing list')
                    
127        self.assertMultiLineEqual(
                    
128            message.get_payload(),
                    
                
test_bool.py https://gitlab.com/envieidoc/Clover | Python | 371 lines
                    
2
                    
3import unittest
                    
4from test import test_support
                    
5
                    
6import os
                    
7
                    
7
                    
8class BoolTest(unittest.TestCase):
                    
9
                    
18
                    
19        self.assertRaises(TypeError, int.__new__, bool, 0)
                    
20
                    
26            fo = open(test_support.TESTFN, "rb")
                    
27            self.assertEqual(fo.read(), 'False True\n')
                    
28        finally:
                    
                
test_numbers.py https://bitbucket.org/glix/python.git | Python | 276 lines
                    
1from ctypes import *
                    
2import unittest
                    
3import struct
                    
52
                    
53class NumberTestCase(unittest.TestCase):
                    
54
                    
73    def test_bool_values(self):
                    
74        from operator import truth
                    
75        for t, v in zip(bool_types, bool_values):
                    
130            self.assertRaises(TypeError, t, 3.14)
                    
131            self.assertRaises(TypeError, t, f)
                    
132            self.failUnlessEqual(t(i).value, 2)
                    
157    def test_int_from_address(self):
                    
158        from array import array
                    
159        for t in signed_types + unsigned_types:
                    
                
tests.py https://github.com/alexleninn/sssssssssssssssssssssss.git | Python | 299 lines
                    
1import os, unittest
                    
2from django.contrib.gis.geos import *
                    
2from django.contrib.gis.geos import *
                    
3from django.contrib.gis.db.backend import SpatialBackend
                    
4from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
                    
5from django.contrib.gis.tests.utils import no_mysql, no_oracle, no_spatialite
                    
6from django.conf import settings
                    
7from models import City, Location, DirectoryEntry, Parcel, Book, Author
                    
13
                    
14class RelatedGeoModelTest(unittest.TestCase):
                    
15
                    
30                nm, st, lon, lat = ref
                    
31                self.assertEqual(nm, c.name)
                    
32                self.assertEqual(st, c.state)
                    
154        qs = Parcel.objects.filter(center1=F('city__location__point'))
                    
155        self.assertEqual(1, len(qs))
                    
156        self.assertEqual('P1', qs[0].name)
                    
                
iq.py https://github.com/kulikov/python-tools.git | Python | 208 lines
                    
4
                    
5import unittest
                    
6
                    
6
                    
7from pyxmpp2.etree import ElementTree
                    
8
                    
8
                    
9from pyxmpp2.iq import Iq
                    
10from pyxmpp2.jid import JID
                    
10from pyxmpp2.jid import JID
                    
11from pyxmpp2.stanzapayload import XMLPayload
                    
12from pyxmpp2.error import StanzaErrorElement
                    
44
                    
45class TestIq(unittest.TestCase):
                    
46    def check_iq1(self, iq):
                    
                
test_hashlib.py https://github.com/enricosada/IronLanguages.git | Python | 364 lines
                    
13try:
                    
14    import threading
                    
15except ImportError:
                    
16    threading = None
                    
17import unittest
                    
18import warnings
                    
35
                    
36class HashLibTestCase(unittest.TestCase):
                    
37    supported_hash_names = ( 'md5', 'MD5', 'sha1', 'SHA1',
                    
89            self.constructors_to_test['md5'].add(_md5.new)
                    
90        _sha = self._conditional_import_module('_sha')
                    
91        if _sha:
                    
251
                    
252    @unittest.skipIf(test_support.is_cli, "http://ironpython.codeplex.com/workitem/16870")
                    
253    def test_case_sha224_3(self):
                    
                
test_archive_util.py https://github.com/albertz/CPython.git | Python | 394 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_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"""
                    
                
api.py https://github.com/dafrito/trac-mirror.git | Python | 220 lines
                    
14import doctest
                    
15import unittest
                    
16from StringIO import StringIO
                    
28
                    
29class GetMimeTypeTestCase(unittest.TestCase):
                    
30
                    
72
                    
73class MimeviewTestCase(unittest.TestCase):
                    
74
                    
102        self.assertEqual(Converter1(self.env), conversions[1][-1])
                    
103        self.assertEqual(Converter2(self.env), conversions[2][-1])
                    
104
                    
104
                    
105class GroupLinesTestCase(unittest.TestCase):
                    
106
                    
                
test_callbacks.py https://bitbucket.org/lbesson/web-sphinx-scripts.git | Python | 248 lines
                    
1import unittest
                    
2from ctypes import *
                    
4
                    
5class Callbacks(unittest.TestCase):
                    
6    functype = CFUNCTYPE
                    
19        if typ == c_float:
                    
20            self.assertAlmostEqual(result, arg, places=5)
                    
21        else:
                    
21        else:
                    
22            self.assertEqual(self.got_args, (arg,))
                    
23            self.assertEqual(result, arg)
                    
120        # The type is checked when the prototype is called
                    
121        self.assertRaises(TypeError, prototype, lambda: None)
                    
122
                    
152
                    
153class SampleCallbacksTestCase(unittest.TestCase):
                    
154
                    
                
bencode_tests.py https://gitlab.com/lukaf/python-bittorrent | Python | 464 lines
                    
6
                    
7class Walk(unittest.TestCase):
                    
8	""" Check the function walk() works correctly. """
                    
99
                    
100class Ben_Type(unittest.TestCase):
                    
101	""" Check the function ben_type() works correctly. """
                    
375
                    
376class Decode_Dict(unittest.TestCase):
                    
377	""" Check the function decode_dict() works correctly. """
                    
407
                    
408class Encode(unittest.TestCase):
                    
409	""" Check the encode() function works. As this dispatches to the other
                    
436
                    
437class Decode(unittest.TestCase):
                    
438	""" Check the decode() function works. As this dispatches to the other
                    
                
test_commands.py https://gitlab.com/e0/scrapy | Python | 293 lines
                    
1import os
                    
2import sys
                    
2import sys
                    
3import subprocess
                    
4import tempfile
                    
4import tempfile
                    
5from time import sleep
                    
6from os.path import exists, join, abspath
                    
6from os.path import exists, join, abspath
                    
7from shutil import rmtree, copytree
                    
8from tempfile import mkdtemp
                    
10
                    
11from twisted.trial import unittest
                    
12from twisted.internet import defer
                    
21
                    
22class ProjectTest(unittest.TestCase):
                    
23    project_name = 'testproject'
                    
                
test_turtle.py https://github.com/albertz/CPython.git | 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_unicode_file_functions.py https://github.com/albertz/CPython.git | 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/pmuontains/Odoo | 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:
                    
                
font_test.py https://bitbucket.org/julian_meyer/boxes.git | Python | 385 lines
                    
13if is_pygame_pkg:
                    
14    from pygame.tests.test_utils import test_not_implemented, unittest, \
                    
15                                        geterror
                    
16else:
                    
17    from test.test_utils import test_not_implemented, unittest, geterror
                    
18import pygame
                    
20
                    
21class FontModuleTest( unittest.TestCase ):
                    
22    def setUp(self):
                    
129
                    
130class FontTypeTest( unittest.TestCase ):
                    
131    def setUp(self):
                    
295
                    
296class VisualTests( unittest.TestCase ):
                    
297    __tags__ = ['interactive']
                    
                
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_usage.py https://github.com/analogue/mythbox.git | Python | 372 lines
                    
32
                    
33class ParseCorrectnessTest(unittest.TestCase):
                    
34    """
                    
82
                    
83class TypedTestCase(unittest.TestCase):
                    
84    """
                    
143
                    
144class WrongTypedTestCase(unittest.TestCase):
                    
145    """
                    
315
                    
316class HelpStringTest(unittest.TestCase):
                    
317    def setUp(self):
                    
347
                    
348class PortCoerceTestCase(unittest.TestCase):
                    
349    """
                    
                
test_cluster.py https://gitlab.com/africanresearchcloud/hpc | Python | 391 lines
                    
18
                    
19from __future__ import absolute_import
                    
20
                    
26import tempfile
                    
27import unittest
                    
28
                    
39
                    
40class TestCluster(unittest.TestCase):
                    
41
                    
104        self.assertEqual(size + 1, len(cluster.nodes['compute']))
                    
105        self.assertEqual(cluster.nodes['compute'][3].name, name)
                    
106
                    
249
                    
250class TestNode(unittest.TestCase):
                    
251
                    
                
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
                    
                
extract_sqlite_api_unittest.py https://github.com/chromium/chromium.git | Python | 295 lines
                    
10
                    
11from importlib.machinery import SourceFileLoader
                    
12import os
                    
15import tempfile
                    
16import unittest
                    
17
                    
18
                    
19class ExtractSqliteApiUnittest(unittest.TestCase):
                    
20    def setUp(self):
                    
102                         self.extractor.RemoveLineComments('wo/*comment*/rd;'))
                    
103        self.assertEqual(
                    
104            'word;*/', self.extractor.RemoveLineComments('wo/*comment*/rd;*/'))
                    
290        with open(output_file, 'r') as f:
                    
291            self.assertEqual(f.read(), golden_output)
                    
292
                    
                
test_protocols.py https://github.com/RoDaniel/featurehouse.git | Python | 315 lines
                    
3"""
                    
4from twisted.trial import unittest
                    
5from twisted.protocols import basic, wire, portforward
                    
154        self.assertEquals(a.received, ['produce', 'hello world', 'unproduce', 'goodbye'])
                    
155class LineOnlyReceiverTestCase(unittest.TestCase):
                    
156    buffer = """foo
                    
198            self.assertEquals(r.transport.closed, 1)
                    
199class NetstringReceiverTestCase(unittest.TestCase, LPTestCaseMixin):
                    
200    strings = ['hello', 'world', 'how', 'are', 'you123', ':today', "a"*515]
                    
252        self.pauseProducing()
                    
253class ProducerTestCase(unittest.TestCase):
                    
254    def testPauseResume(self):
                    
285        self.failIf(p.paused)
                    
286class Portforwarding(unittest.TestCase):
                    
287    def testPortforward(self):
                    
                
test_parser.py https://bitbucket.org/x893/sirflive.git | Python | 408 lines
                    
1import parser
                    
2import unittest
                    
3from test import test_support
                    
10
                    
11class RoundtripLegalSyntaxTestCase(unittest.TestCase):
                    
12
                    
138        self.check_suite("from sys.path import dirname, basename")
                    
139        self.check_suite("from sys.path import (dirname, basename)")
                    
140        self.check_suite("from sys.path import (dirname, basename,)")
                    
141        self.check_suite(
                    
142            "from sys.path import dirname as my_dirname, basename")
                    
143        self.check_suite(
                    
172
                    
173class IllegalSyntaxTestCase(unittest.TestCase):
                    
174
                    
                
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
                    
                
hid_gadget_test.py https://github.com/chromium/chromium.git | 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
                    
                
test_BLAKE2.py https://gitlab.com/abhi1tb/build | Python | 443 lines
                    
31import re
                    
32import unittest
                    
33from binascii import unhexlify, hexlify
                    
42
                    
43class Blake2Test(unittest.TestCase):
                    
44
                    
327
                    
328class Blake2TestVector1(unittest.TestCase):
                    
329
                    
372
                    
373class Blake2TestVector2(unittest.TestCase):
                    
374
                    
440if __name__ == '__main__':
                    
441    import unittest
                    
442    suite = lambda: unittest.TestSuite(get_tests())
                    
                
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
                    
                
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_paragraph.py https://github.com/albertz/CPython.git | Python | 379 lines
                    
40
                    
41class FindTest(unittest.TestCase):
                    
42    """Test the find_paragraph function in paragraph module.
                    
159
                    
160class ReformatFunctionTest(unittest.TestCase):
                    
161    """Test the reformat_paragraph function without the editor window."""
                    
185
                    
186class ReformatCommentTest(unittest.TestCase):
                    
187    """Test the reformat_comment function without the editor window."""
                    
211
                    
212class FormatClassTest(unittest.TestCase):
                    
213    def test_init_close(self):
                    
243
                    
244class FormatEventTest(unittest.TestCase):
                    
245    """Test the formatting of text inside a Text widget.
                    
                
test_urllibnet.py https://bitbucket.org/glix/python.git | Python | 194 lines
                    
2
                    
3import unittest
                    
4from test import test_support
                    
25
                    
26class URLTimeoutTest(unittest.TestCase):
                    
27
                    
39
                    
40class urlopenNetworkTests(unittest.TestCase):
                    
41    """Tests urllib.urlopen using the network.
                    
90                         "mimetools.Message")
                    
91            self.assertEqual(info_obj.getsubtype(), "html")
                    
92
                    
141
                    
142class urlretrieveNetworkTests(unittest.TestCase):
                    
143    """Tests urllib.urlretrieve using the network."""
                    
                
test_flow.py https://github.com/jcrobak/hue.git | Python | 491 lines
                    
12from twisted.flow.threads import Threaded, QueryIterator
                    
13from twisted.trial import unittest
                    
14from twisted.python import failure
                    
229
                    
230class FlowTest(unittest.TestCase):
                    
231    def testNotReady(self):
                    
237        rhs = list(flow.Block('string'))
                    
238        self.assertEqual(lhs,rhs)
                    
239
                    
299        rhs = list(flow.Block(mrg))
                    
300        self.assertEqual(lhs,rhs)
                    
301
                    
411
                    
412class ThreadedFlowTest(unittest.TestCase):
                    
413    if interfaces.IReactorThreads(reactor, None) is None:
                    
                
test_it.py https://gitlab.com/admin-github-cloud/pattern | Python | 272 lines
                    
2import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
                    
3import unittest
                    
4import subprocess
                    
14
                    
15class TestInflection(unittest.TestCase):
                    
16
                    
41        v = it.referenced("amica", gender="f")
                    
42        self.assertEqual(v, "un'amica")
                    
43        print("pattern.it.article()")
                    
104            n += 1
                    
105        self.assertTrue(float(i) / n > 0.81)
                    
106        print("pattern.it.inflect.verbs.find_lemma()")
                    
197
                    
198class TestParser(unittest.TestCase):
                    
199    
                    
                
test_shutil.py https://bitbucket.org/glix/python.git | Python | 371 lines
                    
2
                    
3import unittest
                    
4import shutil
                    
12
                    
13class TestShutil(unittest.TestCase):
                    
14    def test_rmtree_errors(self):
                    
16        filename = tempfile.mktemp()
                    
17        self.assertRaises(OSError, shutil.rmtree, filename)
                    
18
                    
145            # checking the result: some elements should not be copied
                    
146            self.assert_(exists(join(dst_dir, 'test.txt')))
                    
147            self.assert_(not exists(join(dst_dir, 'test.tmp')))
                    
229
                    
230class TestMove(unittest.TestCase):
                    
231
                    
                
test_basic_ops.py https://github.com/goodfeli/Theano.git | Python | 327 lines
                    
1import unittest
                    
2from itertools import izip
                    
9from theano.tensor.tests.test_basic import safe_make_node
                    
10from theano.tests.unittest_tools import SkipTest
                    
11from numpy.testing.noseclasses import KnownFailureTest
                    
12
                    
13import theano.sandbox.gpuarray
                    
14
                    
30                                          gpuarray_shared_constructor)
                    
31from theano.sandbox.gpuarray.basic_ops import (host_from_gpu, gpu_from_host,
                    
32                                               gpu_alloc, gpu_from_cuda,
                    
34
                    
35from theano.tests import unittest_tools as utt
                    
36utt.seed_rng()
                    
111
                    
112    class Checker(unittest.TestCase):
                    
113        op = staticmethod(_op)
                    
                
LCGImpl_t.py https://github.com/dmwm/WMCore.git | Python | 160 lines
                    
2import os
                    
3import unittest
                    
4
                    
6
                    
7from WMCore.Storage.Backends.LCGImpl import LCGImpl
                    
8
                    
9
                    
10class LCGImplTest(unittest.TestCase):
                    
11    def setUp(self):
                    
30        for setup in setups:
                    
31            self.assertIn(setup, testLCGImpl.setups)
                    
32
                    
33    def testCreateSourceName_startswithSlash(self):
                    
34        self.assertEqual("file://name", self.LCGImpl.createSourceName("protocol", "//name"))
                    
35
                    
                
test_numbers.py https://github.com/lalitjsraks/pypy.git | Python | 246 lines
                    
1from ctypes import *
                    
2import unittest
                    
3import sys, struct
                    
42
                    
43class NumberTestCase(unittest.TestCase):
                    
44
                    
66        for t in signed_types + unsigned_types + float_types:
                    
67            self.assertRaises(TypeError, t, "")
                    
68            self.assertRaises(TypeError, t, None)
                    
114        for t in signed_types + unsigned_types:
                    
115            self.assertRaises(TypeError, t, 3.14)
                    
116            self.assertRaises(TypeError, t, f)
                    
160    def test_float_from_address(self):
                    
161        from array import array
                    
162        for t in float_types:
                    
                
test_unicodedata.py https://github.com/albertz/CPython.git | Python | 329 lines
                    
9import sys
                    
10import unittest
                    
11import hashlib
                    
11import hashlib
                    
12from test.support import script_helper
                    
13
                    
19
                    
20class UnicodeMethodsTest(unittest.TestCase):
                    
21
                    
65        result = h.hexdigest()
                    
66        self.assertEqual(result, self.expectedchecksum)
                    
67
                    
67
                    
68class UnicodeDatabaseTest(unittest.TestCase):
                    
69
                    
                
api.py https://bitbucket.org/bluezoo/trac.git | Python | 364 lines
                    
15import io
                    
16import unittest
                    
17
                    
30
                    
31class GetMimeTypeTestCase(unittest.TestCase):
                    
32
                    
74
                    
75class MimeviewTestCase(unittest.TestCase):
                    
76
                    
106
                    
107class GroupLinesTestCase(unittest.TestCase):
                    
108
                    
239
                    
240class MimeviewConverterTestCase(unittest.TestCase):
                    
241
                    
                
tests.py https://github.com/Tippr/django.git | Python | 364 lines
                    
1import datetime
                    
2from decimal import Decimal
                    
3
                    
4from django import test
                    
5from django import forms
                    
8from django.db.models.fields.files import FieldFile
                    
9from django.utils import unittest
                    
10
                    
118
                    
119class DateTimeFieldTests(unittest.TestCase):
                    
120    def test_datetimefield_to_python_usecs(self):
                    
135
                    
136class BooleanFieldTests(unittest.TestCase):
                    
137    def _test_get_db_prep_lookup(self, f):
                    
328
                    
329class FileFieldTests(unittest.TestCase):
                    
330    def test_clearable(self):
                    
                
test_functions.py https://bitbucket.org/hacman/python.git | Python | 408 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:
                    
                
log_testing.py https://github.com/chromium/chromium.git | Python | 233 lines
                    
32import logging
                    
33import unittest
                    
34
                    
51        Args:
                    
52            test_case: A unittest.TestCase instance.
                    
53        """
                    
77
                    
78      class SampleTest(unittest.TestCase):
                    
79
                    
126        This method should normally be called in the setUp() method
                    
127        of a unittest.TestCase.  See the docstring of this class
                    
128        for more details.
                    
130        Args:
                    
131            test_case: A unittest.TestCase instance.
                    
132            logging_level: An integer logging level that is the minimum level
                    
                
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
                    
                
test_random.py https://gitlab.com/abhi1tb/build | Python | 167 lines
                    
27import sys
                    
28import unittest
                    
29from Crypto.Util.py3compat import b
                    
30
                    
31class SimpleTest(unittest.TestCase):
                    
32    def runTest(self):
                    
33        """Crypto.Random.new()"""
                    
34        # Import the Random module and try to use it
                    
35        from Crypto import Random
                    
38        y = randobj.read(16)
                    
39        self.assertNotEqual(x, y)
                    
40        z = Random.get_random_bytes(16)
                    
40        z = Random.get_random_bytes(16)
                    
41        self.assertNotEqual(x, z)
                    
42        self.assertNotEqual(y, z)
                    
                
test_unix.py https://github.com/lvh/twisted.git | Python | 405 lines
                    
12from twisted.python import lockfile
                    
13from twisted.trial import unittest
                    
14
                    
26
                    
27class UnixSocketTestCase(unittest.TestCase):
                    
28    """
                    
48            expected = address.UNIXAddress(peername)
                    
49            self.assertEqual(serverFactory.peerAddresses, [expected])
                    
50            self.assertEqual(proto.transport.getPeer(), expected)
                    
192        self.assertEqual(repr(unixPort), connectedString)
                    
193        self.assertEqual(str(unixPort), connectedString)
                    
194
                    
288
                    
289class DatagramUnixSocketTestCase(unittest.TestCase):
                    
290    """
                    
                
test_pep292.py https://bitbucket.org/glix/python.git | Python | 194 lines
                    
4
                    
5import unittest
                    
6from string import Template
                    
22
                    
23class TestTemplate(unittest.TestCase):
                    
24    def test_regular_templates(self):
                    
27                         'tim likes to eat a bag of ham worth $100')
                    
28        self.assertRaises(KeyError, s.substitute, dict(who='tim'))
                    
29
                    
80    def test_invalid_placeholders(self):
                    
81        raises = self.assertRaises
                    
82        s = Template('$who likes $')
                    
173        eq = self.assertEqual
                    
174        raises = self.assertRaises
                    
175        class AmpersandTemplate(Template):
                    
                
tests.py https://github.com/Gautier/django_old.git | Python | 264 lines
                    
3"""
                    
4from __future__ import absolute_import
                    
5
                    
15from django.utils import unittest
                    
16from django.utils.importlib import import_module
                    
17
                    
24
                    
25class DjangoTestRunnerTests(unittest.TestCase):
                    
26    def setUp(self):
                    
34    def test_failfast(self):
                    
35        class MockTestOne(unittest.TestCase):
                    
36            def runTest(self):
                    
53
                    
54class DependencyOrderingTests(unittest.TestCase):
                    
55
                    
                
RequestInfoCollection_t.py https://github.com/dmwm/WMCore.git | Python | 190 lines
                    
2"""
                    
3Unittests for the RequestInfoCollection WMStats module
                    
4"""
                    
4"""
                    
5from __future__ import division, print_function
                    
6
                    
6
                    
7import unittest
                    
8
                    
31
                    
32class MyTestCase(unittest.TestCase):
                    
33
                    
35        if PY3:
                    
36            self.assertItemsEqual = self.assertCountEqual
                    
37
                    
                
test_protocol.py https://github.com/thirumg/Avro.NET.git | Python | 257 lines
                    
18"""
                    
19import unittest
                    
20from avro import protocol
                    
174
                    
175class TestProtocol(unittest.TestCase):
                    
176  def test_parse(self):
                    
195      (num_correct, len(EXAMPLES))
                    
196    self.assertEqual(num_correct, len(EXAMPLES), fail_msg)
                    
197
                    
221      (num_correct, len(VALID_EXAMPLES))
                    
222    self.assertEqual(num_correct, len(VALID_EXAMPLES), fail_msg)
                    
223
                    
253      (num_correct, len(VALID_EXAMPLES))
                    
254    self.assertEqual(num_correct, len(VALID_EXAMPLES), fail_msg)
                    
255
                    
                
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_dbshelve.py https://github.com/jdhardy/ironpython.git | Python | 405 lines
                    
4
                    
5import os, string, sys
                    
6import random
                    
6import random
                    
7import unittest
                    
8
                    
9
                    
10from test_all import db, dbshelve, test_support, verbose, \
                    
11        get_new_environment_path, get_new_database_path
                    
15if sys.version_info < (2, 4) :
                    
16    from sets import Set as set
                    
17
                    
34
                    
35class DBShelveTestCase(unittest.TestCase):
                    
36    if sys.version_info < (2, 4):
                    
                
test_enumerate.py https://github.com/rpattabi/ironruby.git | Python | 262 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)
                    
111        # whenever nothing else holds a reference to it
                    
112        self.assertEqual(len(set(map(id, list(enumerate(self.seq))))), len(self.seq))
                    
113        self.assertEqual(len(set(map(id, enumerate(self.seq)))), min(1,len(self.seq)))
                    
130
                    
131class TestReversed(unittest.TestCase):
                    
132
                    
250def test_main(verbose=None):
                    
251    test_support.run_unittest(__name__)
                    
252
                    
                
test_gzip.py https://github.com/rpattabi/ironruby.git | Python | 271 lines
                    
4
                    
5import unittest
                    
6from test import test_support
                    
6from test import test_support
                    
7import os
                    
8import io
                    
24
                    
25class TestGzip(unittest.TestCase):
                    
26    filename = test_support.TESTFN
                    
163        f = gzip.GzipFile(self.filename, 'r')
                    
164        self.assertEqual(f.myfileobj.mode, 'rb')
                    
165        f.close()
                    
170            self.assertTrue(hasattr(f, "name"))
                    
171            self.assertEqual(f.name, self.filename)
                    
172            f.close()
                    
                
test_codeop.py https://github.com/rpattabi/ironruby.git | Python | 310 lines
                    
5import unittest
                    
6from test.test_support import run_unittest, is_jython, due_to_ironpython_bug, is_cli
                    
7
                    
10if is_jython:
                    
11    import sys
                    
12    import cStringIO
                    
19
                    
20class CodeopTests(unittest.TestCase):
                    
21
                    
59    def test_valid(self):
                    
60        av = self.assertValid
                    
61
                    
69                                    PyCF_DONT_IMPLY_DEDENT))
                    
70            self.assertEquals(compile_command("\n"),
                    
71                            compile("pass", "<input>", 'single',
                    
                
test_os.py https://bitbucket.org/x893/sirflive.git | Python | 368 lines
                    
5import os
                    
6import unittest
                    
7import warnings
                    
12
                    
13class TemporaryFileTests(unittest.TestCase):
                    
14    def setUp(self):
                    
83# Test attributes on return values from os.*stat* family.
                    
84class StatAttributeTests(unittest.TestCase):
                    
85    def setUp(self):
                    
336
                    
337class DevNullTests (unittest.TestCase):
                    
338    def test_devnull(self):
                    
345
                    
346class URandomTests (unittest.TestCase):
                    
347    def test_urandom(self):
                    
                
json3_output_unittest.py https://github.com/chromium/chromium.git | Python | 205 lines
                    
5import copy
                    
6import unittest
                    
7
                    
7
                    
8from core.results_processor.formatters import json3_output
                    
9from core.results_processor import testing
                    
11
                    
12class Json3OutputTest(unittest.TestCase):
                    
13  def setUp(self):
                    
21    # Convert should not modify the original intermediate results.
                    
22    self.assertEqual(test_results_copy, test_results)
                    
23    return results
                    
27    for key in (benchmark, story):
                    
28      self.assertIn(key, node)
                    
29      node = node[key]
                    
                
test_rfc822.py https://github.com/DarioGT/OMS-PluginXML.git | Python | 211 lines
                    
3import test_support
                    
4import unittest
                    
5
                    
6try:
                    
7    from cStringIO import StringIO
                    
8except ImportError:
                    
8except ImportError:
                    
9    from StringIO import StringIO
                    
10
                    
11
                    
12class MessageTestCase(unittest.TestCase):
                    
13    def create_message(self, msg):
                    
20        self.assert_(msg.get("TO") == '"last, first" <userid@foo.net>')
                    
21        self.assert_(msg.get("No-Such-Header") is None)
                    
22        self.assert_(msg.get("No-Such-Header", "No-Such-Value")
                    
                
 

Source

Language