Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(119)  |  Call(100)  |  Derive(0)  |  Import(19)

src/t/r/tron-0.6.1.1/tests/core/jobrun_test.py   tron(Download)
from testify import TestCase, setup, assert_equal
from testify.assertions import assert_in
from tests.assertions import assert_length, assert_raises, assert_call
from tron import node, event, actioncommand
from tron.core import jobrun, actionrun, actiongraph, job
    def test_set_action_runs_duplicate(self):
        run_collection = mock.create_autospec(actionrun.ActionRunCollection)
        assert_raises(ValueError,
            self.job_run._set_action_runs, run_collection)
 
    def test__getattr__miss(self):
        assert_raises(AttributeError, lambda: self.job_run.bogus)
 
 
class JobRunFromStateTestCase(TestCase):
    def test_restore_state_with_runs(self):
        assert_raises(ValueError,
                self.run_collection.restore_state, None, None, None, None, None)
 
    def test_build_new_run(self):

src/t/r/Tron-HEAD/tests/core/jobrun_test.py   Tron(Download)
from testify import TestCase, setup, assert_equal
from testify.assertions import assert_in
from tests.assertions import assert_length, assert_raises, assert_call
from tron import node, event, actioncommand
from tron.core import jobrun, actionrun, actiongraph, job
    def test_set_action_runs_duplicate(self):
        run_collection = mock.create_autospec(actionrun.ActionRunCollection)
        assert_raises(ValueError,
            self.job_run._set_action_runs, run_collection)
 
    def test__getattr__miss(self):
        assert_raises(AttributeError, lambda: self.job_run.bogus)
 
 
class JobRunFromStateTestCase(TestCase):
    def test_restore_state_with_runs(self):
        assert_raises(ValueError,
                self.run_collection.restore_state, None, None, None, None, None)
 
    def test_build_new_run(self):

src/t/r/tron-0.6.1.1/tests/config/config_parse_test.py   tron(Download)
from tron.config.schedule_parse import ConfigIntervalScheduler
from tron.config.schema import MASTER_NAMESPACE
from tests.assertions import assert_raises
from tron.utils.dicts import FrozenDict
 
        """
        expected_message = "Job test_job0 is missing options: actions"
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected_message, str(exception))
 
        """
        expected_message = "Value at config.jobs.Job.test_job0.actions"
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected_message, str(exception))
 
        """
        expected = "Duplicate name action0_0 at config.jobs.Job.test_job0.actions"
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected, str(exception))
 
        expected_message = ('jobs.MASTER.test_job1.action1_0 has a dependency '
                '"action0_0" that is not in the same job!')
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected_message, str(exception))
 

src/t/r/Tron-HEAD/tests/config/config_parse_test.py   Tron(Download)
from tron.config.schedule_parse import ConfigIntervalScheduler
from tron.config.schema import MASTER_NAMESPACE
from tests.assertions import assert_raises
from tron.utils.dicts import FrozenDict
 
        """
        expected_message = "Job test_job0 is missing options: actions"
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected_message, str(exception))
 
        """
        expected_message = "Value at config.jobs.Job.test_job0.actions"
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected_message, str(exception))
 
        """
        expected = "Duplicate name action0_0 at config.jobs.Job.test_job0.actions"
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected, str(exception))
 
        expected_message = ('jobs.MASTER.test_job1.action1_0 has a dependency '
                '"action0_0" that is not in the same job!')
        exception = assert_raises(ConfigError, valid_config_from_yaml, test_config)
        assert_in(expected_message, str(exception))
 

src/t/r/tron-0.6.1.1/tests/config/config_utils_test.py   tron(Download)
import datetime
import mock
from testify import TestCase, run, assert_equal, setup
from testify.assertions import assert_in
from tests.assertions import assert_raises
    def test_set_item_conflict(self):
        self.dict['a'] = 'something'
        assert_raises(ConfigError, self.dict.__setitem__, 'a', 'next_thing')
 
 
class ValidatorIdentifierTestCase(TestCase):
 
    def test_valid_identifier_too_long(self):
        assert_raises(ConfigError, valid_identifier, 'a' * 256, mock.Mock())
    def test_valid_identifier_invalid_character(self):
        for name in ['invalid space', '*name', '1numberstarted', 123, '']:
            assert_raises(ConfigError, valid_identifier, name, mock.Mock())
 
 
    def test_validator_fails(self):
        self.item_validator.side_effect = ConfigError
        items, context = ['one', 'two'], mock.create_autospec(ConfigContext)
        assert_raises(ConfigError, self.validator, items, context)
 

src/t/r/Tron-HEAD/tests/config/config_utils_test.py   Tron(Download)
import datetime
import mock
from testify import TestCase, run, assert_equal, setup
from testify.assertions import assert_in
from tests.assertions import assert_raises
    def test_set_item_conflict(self):
        self.dict['a'] = 'something'
        assert_raises(ConfigError, self.dict.__setitem__, 'a', 'next_thing')
 
 
class ValidatorIdentifierTestCase(TestCase):
 
    def test_valid_identifier_too_long(self):
        assert_raises(ConfigError, valid_identifier, 'a' * 256, mock.Mock())
    def test_valid_identifier_invalid_character(self):
        for name in ['invalid space', '*name', '1numberstarted', 123, '']:
            assert_raises(ConfigError, valid_identifier, name, mock.Mock())
 
 
    def test_validator_fails(self):
        self.item_validator.side_effect = ConfigError
        items, context = ['one', 'two'], mock.create_autospec(ConfigContext)
        assert_raises(ConfigError, self.validator, items, context)
 

src/t/r/tron-0.6.1.1/tests/serialize/runstate/statemanager_test.py   tron(Download)
import os
import mock
from testify import TestCase, assert_equal, setup, run
 
from tests.assertions import assert_raises
    def test_validate_metadata_mismatch(self):
        metadata = {'version': (200, 1, 1)}
        assert_raises(
                VersionMismatchError, StateMetadata.validate_metadata, metadata)
 
    def test_save_failed(self):
        self.store.save.side_effect = PersistenceStoreError("blah")
        assert_raises(PersistenceStoreError, self.manager.save, None, None, None)
 
    def test_save_while_disabled(self):
    def test_disabled_with_exception(self):
        def testfunc():
            with self.manager.disabled():
                raise ValueError()
        assert_raises(ValueError, testfunc)

src/t/r/Tron-HEAD/tests/serialize/runstate/statemanager_test.py   Tron(Download)
import os
import mock
from testify import TestCase, assert_equal, setup, run
 
from tests.assertions import assert_raises
    def test_validate_metadata_mismatch(self):
        metadata = {'version': (200, 1, 1)}
        assert_raises(
                VersionMismatchError, StateMetadata.validate_metadata, metadata)
 
    def test_save_failed(self):
        self.store.save.side_effect = PersistenceStoreError("blah")
        assert_raises(PersistenceStoreError, self.manager.save, None, None, None)
 
    def test_save_while_disabled(self):
    def test_disabled_with_exception(self):
        def testfunc():
            with self.manager.disabled():
                raise ValueError()
        assert_raises(ValueError, testfunc)

src/t/r/tron-0.6.1.1/tests/commands/client_test.py   tron(Download)
from testify import TestCase, setup, assert_equal, run, setup_teardown
from testify.assertions import assert_in
from tests.assertions import assert_raises
from tests.testingutils import autospec_method
 
    def test_request_error(self):
        exception = assert_raises(client.RequestError,
            self.client.request, '/jobs')
        assert_in(self.url, str(exception))
 
    def test_get_url_from_identifier_no_match(self):
        exc = assert_raises(ValueError,
            get_object_type_from_identifier, self.index, 'MASTER.namec')
        assert_in('namec', str(exc))
 

src/t/r/Tron-HEAD/tests/commands/client_test.py   Tron(Download)
from testify import TestCase, setup, assert_equal, run, setup_teardown
from testify.assertions import assert_in
from tests.assertions import assert_raises
from tests.testingutils import autospec_method
 
    def test_request_error(self):
        exception = assert_raises(client.RequestError,
            self.client.request, '/jobs')
        assert_in(self.url, str(exception))
 
    def test_get_url_from_identifier_no_match(self):
        exc = assert_raises(ValueError,
            get_object_type_from_identifier, self.index, 'MASTER.namec')
        assert_in('namec', str(exc))
 

  1 | 2  Next