PageRenderTime 747ms queryFilters 1ms Sphinxql 710ms app.CodeModel.GetByIds 6ms findMatchingLines 22ms GetByIds 28ms meta 0ms repositoryFilters 11ms languageFilters 0ms sourceFilters 4ms

24,439 results for '"import unittest" unittest.TestCase self.assert lang:Python' (747 ms)

Source

Language

Repository

test_celery_instance.py https://github.com/alexxa/pulp.git | Python | 173 lines
19
20class TestCelerybeatSchedule(unittest.TestCase):
21    """
32        # assertion.
33        self.assertEqual(len(celery_instance.celery.conf['CELERYBEAT_SCHEDULE']), 3)
34
44        }
45        self.assertEqual(reap, expected_reap)
46
55        }
56        self.assertEqual(celery_instance.celery.conf['CELERYBEAT_SCHEDULE']['monthly_maintenance'],
57                         expected_monthly_maintenance)
67        }
68        self.assertEqual(
69            celery_instance.celery.conf['CELERYBEAT_SCHEDULE']['download_deferred_content'],
test_celery_instance.py https://github.com/devops-senpai/pulp.git | Python | 167 lines
28
29class TestCelerybeatSchedule(unittest.TestCase):
30    """
41        # assertion.
42        self.assertEqual(len(celery_instance.celery.conf['CELERYBEAT_SCHEDULE']), 3)
43
52        }
53        self.assertEqual(celery_instance.celery.conf['CELERYBEAT_SCHEDULE']['babysit'],
54                         expected_babysit)
65        }
66        self.assertEqual(reap, expected_reap)
67
76        }
77        self.assertEqual(celery_instance.celery.conf['CELERYBEAT_SCHEDULE']['monthly_maintenance'],
78                         expected_monthly_maintenance)
test_primary.py https://github.com/ATIX-AG/pulp_rpm.git | Python | 245 lines
11
12class TestProcessPackageElement(unittest.TestCase):
13    """
34
35        self.assertEqual(model.checksumtype, 'sha1')
36
44        rpms = list(rpms)
45        self.assertEqual(len(rpms), 1)
46        model = rpms[0]
47
48        self.assertTrue(model.CHECKSUM_TEMPLATE in model.raw_xml)
49        self.assertTrue(model.CHECKSUMTYPE_TEMPLATE in model.raw_xml)
51
52class TestProcessSRPMElement(unittest.TestCase):
53    def test_fedora18_real_data(self):
test_users.py https://github.com/alexxa/pulp.git | Python | 173 lines
15
16class TestUserSearchView(unittest.TestCase):
17    """
23        """
24        self.assertEqual(UserSearchView.response_builder,
25                         util.generate_json_response_with_pulp_encoder)
25                         util.generate_json_response_with_pulp_encoder)
26        self.assertEqual(UserSearchView.model, model.User)
27        self.assertEqual(UserSearchView.model.SERIALIZER, serializers.User)
29
30class TestUsersView(unittest.TestCase):
31    """
48        mock_resp.assert_called_once_with(mock_model.SERIALIZER.return_value.data)
49        self.assertTrue(response is mock_resp.return_value)
50
test_iso_distributor_configuration.py https://github.com/arnisoph/pulp_rpm.git | Python | 117 lines
23
24class TestValidate(unittest.TestCase):
25    """
40        # Assert the return values
41        self.assertEqual(valid, True)
42        self.assertEqual(msg, None)
44        # Assert that _validate_required_bool was called twice with the correct parameters
45        self.assertEqual(_validate_required_bool.call_count, 2)
46        self.assertEqual(_validate_required_bool.mock_calls[0][1][0], config)
46        self.assertEqual(_validate_required_bool.mock_calls[0][1][0], config)
47        self.assertEqual(_validate_required_bool.mock_calls[0][1][1], constants.CONFIG_SERVE_HTTP)
48        self.assertEqual(_validate_required_bool.mock_calls[1][1][0], config)
48        self.assertEqual(_validate_required_bool.mock_calls[1][1][0], config)
49        self.assertEqual(_validate_required_bool.mock_calls[1][1][1], constants.CONFIG_SERVE_HTTPS)
50
test_iso_distributor_configuration.py https://github.com/ATIX-AG/pulp_rpm.git | Python | 110 lines
10
11class TestValidate(unittest.TestCase):
12    """
29        # Assert the return values
30        self.assertEqual(valid, True)
31        self.assertEqual(msg, None)
33        # Assert that _validate_required_bool was called twice with the correct parameters
34        self.assertEqual(_validate_required_bool.call_count, 2)
35        self.assertEqual(_validate_required_bool.mock_calls[0][1][0], config)
35        self.assertEqual(_validate_required_bool.mock_calls[0][1][0], config)
36        self.assertEqual(_validate_required_bool.mock_calls[0][1][1], constants.CONFIG_SERVE_HTTP)
37        self.assertEqual(_validate_required_bool.mock_calls[1][1][0], config)
37        self.assertEqual(_validate_required_bool.mock_calls[1][1][0], config)
38        self.assertEqual(_validate_required_bool.mock_calls[1][1][1], constants.CONFIG_SERVE_HTTPS)
39
test_iso_distributor_configuration.py https://github.com/bowlofeggs/pulp_rpm.git | Python | 110 lines
10
11class TestValidate(unittest.TestCase):
12    """
29        # Assert the return values
30        self.assertEqual(valid, True)
31        self.assertEqual(msg, None)
33        # Assert that _validate_required_bool was called twice with the correct parameters
34        self.assertEqual(_validate_required_bool.call_count, 2)
35        self.assertEqual(_validate_required_bool.mock_calls[0][1][0], config)
35        self.assertEqual(_validate_required_bool.mock_calls[0][1][0], config)
36        self.assertEqual(_validate_required_bool.mock_calls[0][1][1], constants.CONFIG_SERVE_HTTP)
37        self.assertEqual(_validate_required_bool.mock_calls[1][1][0], config)
37        self.assertEqual(_validate_required_bool.mock_calls[1][1][0], config)
38        self.assertEqual(_validate_required_bool.mock_calls[1][1][1], constants.CONFIG_SERVE_HTTPS)
39
test_primary.py https://github.com/bowlofeggs/pulp_rpm.git | Python | 231 lines
11
12class TestProcessPackageElement(unittest.TestCase):
13    """
34
35        self.assertEqual(model.checksumtype, 'sha1')
36
37
38class TestProcessSRPMElement(unittest.TestCase):
39    def test_fedora18_real_data(self):
44
45        self.assertEqual(len(rpms), 1)
46        model = rpms[0]
46        model = rpms[0]
47        self.assertTrue(isinstance(model, models.SRPM))
48        self.assertEqual(model.name, 'openhpi-subagent')
test_reaper.py https://github.com/devops-senpai/pulp.git | Python | 91 lines
27
28class TestCreateExpiredObjectId(unittest.TestCase):
29    """
43        now_oid = ObjectId()
44        self.assertTrue(
45            (now_oid.generation_time - expired_oid.generation_time) >= timedelta(seconds=1))
45            (now_oid.generation_time - expired_oid.generation_time) >= timedelta(seconds=1))
46        self.assertTrue(
47            (now_oid.generation_time - expired_oid.generation_time) < timedelta(seconds=2))
48        # Also, let's make sure the type is correct
49        self.assertTrue(isinstance(expired_oid, ObjectId))
50
67        chec.insert(event, safe=True)
68        self.assertTrue(chec.find({'_id': event['_id']}).count() == 1)
69        # Let's mock getfloat to pretend that the user said they want to reap things that are a day
test_risk_compare_batch_iterative.py https://github.com/aidoom/zipline.git | Python | 162 lines
30
31class RiskCompareIterativeToBatch(unittest.TestCase):
32    """
102
103            self.assertEqual(
104                risk_metrics_original.start_date,
105                risk_metrics_refactor.start_date)
106            self.assertEqual(
107                risk_metrics_original.end_date,
108                risk_metrics_refactor.algorithm_returns.index[-1])
109            self.assertEqual(
110                risk_metrics_original.treasury_period_return,
123            risk_refactor_dict = risk_metrics_refactor.to_dict()
124            self.assertEqual(set(risk_original_dict.keys()),
125                             set(risk_refactor_dict.keys()))
test_risk_compare_batch_iterative.py https://github.com/quincysmiith/zipline.git | Python | 165 lines
31
32class RiskCompareIterativeToBatch(unittest.TestCase):
33    """
105
106            self.assertEqual(
107                risk_metrics_original.start_date,
108                risk_metrics_refactor.start_date)
109            self.assertEqual(
110                risk_metrics_original.end_date,
111                risk_metrics_refactor.algorithm_returns.index[-1])
112            self.assertEqual(
113                risk_metrics_original.treasury_period_return,
126            risk_refactor_dict = risk_metrics_refactor.to_dict()
127            self.assertEqual(set(risk_original_dict.keys()),
128                             set(risk_refactor_dict.keys()))
test_risk_compare_batch_iterative.py https://gitlab.com/dandrews/zipline.git | Python | 131 lines
29
30class RiskCompareIterativeToBatch(unittest.TestCase):
31    """
82
83            self.assertEqual(
84                risk_metrics_original.start_date,
85                risk_metrics_refactor.start_date)
86            self.assertEqual(
87                risk_metrics_original.end_date,
88                risk_metrics_refactor.end_date)
89            self.assertEqual(
90                risk_metrics_original.treasury_duration,
91                risk_metrics_refactor.treasury_duration)
92            self.assertEqual(
93                risk_metrics_original.treasury_curve,
test_plugins_configuration_utils.py https://github.com/arnisoph/pulp_rpm.git | Python | 53 lines
19
20class TestValidateNonRequiredBool(unittest.TestCase):
21    """
42        except configuration_utils.ValidationError, e:
43            self.assertEqual(str(e), 'The configuration parameter <setting_name> may only be set to a '
44                                     'boolean value, but is currently set to <Not true or false.>.')
test_plugins_configuration_utils.py https://github.com/ATIX-AG/pulp_rpm.git | Python | 42 lines
6
7class TestValidateNonRequiredBool(unittest.TestCase):
8    """
30        except configuration_utils.ValidationError, e:
31            self.assertEqual(str(e),
32                             'The configuration parameter <setting_name> may only be set to a '
test_plugins_configuration_utils.py https://github.com/bowlofeggs/pulp_rpm.git | Python | 42 lines
6
7class TestValidateNonRequiredBool(unittest.TestCase):
8    """
30        except configuration_utils.ValidationError, e:
31            self.assertEqual(str(e),
32                             'The configuration parameter <setting_name> may only be set to a '
test_unittest.py https://bitbucket.org/vionika/spin.android.git | Python | 992 lines
10        import unittest
11        class MyTestCase(unittest.TestCase):
12            def testpassing(self):
12            def testpassing(self):
13                self.assertEqual('foo', 'foo')
14            def test_failing(self):
14            def test_failing(self):
15                self.assertEqual('foo', 'bar')
16    """
26        import unittest
27        class MyTestCaseWithRunTest(unittest.TestCase):
28            def runTest(self):
28            def runTest(self):
29                self.assertEqual('foo', 'foo')
30        class MyTestCaseWithoutRunTest(unittest.TestCase):
test_unittest.py https://bitbucket.org/vionika/spin.android.git | Python | 992 lines
10        import unittest
11        class MyTestCase(unittest.TestCase):
12            def testpassing(self):
12            def testpassing(self):
13                self.assertEqual('foo', 'foo')
14            def test_failing(self):
14            def test_failing(self):
15                self.assertEqual('foo', 'bar')
16    """
26        import unittest
27        class MyTestCaseWithRunTest(unittest.TestCase):
28            def runTest(self):
28            def runTest(self):
29                self.assertEqual('foo', 'foo')
30        class MyTestCaseWithoutRunTest(unittest.TestCase):
test_dal.py https://github.com/eddgt/web2py.git | Python | 1,520 lines
78
79class TestFields(unittest.TestCase):
80
83        # Check that Fields cannot start with underscores
84        self.assertRaises(SyntaxError, Field, '_abc', 'string')
85
86        # Check that Fields cannot contain punctuation other than underscores
87        self.assertRaises(SyntaxError, Field, 'a.bc', 'string')
88
90        for x in ['drop', 'on', 'truncate']:
91            self.assertRaises(SyntaxError, Field, x, 'string')
92
93        # Check that Fields allows underscores in the body of a field name.
94        self.assert_(Field('a_bc', 'string'),
95            "Field isn't allowing underscores in fieldnames.  It should.")
test_dal_nosql.py https://github.com/eddgt/web2py.git | Python | 1,432 lines
116@unittest.skipIf(IS_GAE or IS_IMAP, 'TODO: Datastore throws "AssertionError: SyntaxError not raised"')
117class TestFields(unittest.TestCase):
118
121        # Check that Fields cannot start with underscores
122        self.assertRaises(SyntaxError, Field, '_abc', 'string')
123
124        # Check that Fields cannot contain punctuation other than underscores
125        self.assertRaises(SyntaxError, Field, 'a.bc', 'string')
126
128        for x in ['drop', 'on', 'truncate']:
129            self.assertRaises(SyntaxError, Field, x, 'string')
130
131        # Check that Fields allows underscores in the body of a field name.
132        self.assert_(Field('a_bc', 'string'),
133            "Field isn't allowing underscores in fieldnames.  It should.")
test_dal.py https://github.com/eddgt/web2py.git | Python | 1,520 lines
78
79class TestFields(unittest.TestCase):
80
83        # Check that Fields cannot start with underscores
84        self.assertRaises(SyntaxError, Field, '_abc', 'string')
85
86        # Check that Fields cannot contain punctuation other than underscores
87        self.assertRaises(SyntaxError, Field, 'a.bc', 'string')
88
90        for x in ['drop', 'on', 'truncate']:
91            self.assertRaises(SyntaxError, Field, x, 'string')
92
93        # Check that Fields allows underscores in the body of a field name.
94        self.assert_(Field('a_bc', 'string'),
95            "Field isn't allowing underscores in fieldnames.  It should.")
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21