<s> from unittest import skipIf <EOL> import django <EOL> from discover_jenkins import runner , tasks <EOL> from django . test import TestCase <EOL> try : <EOL> from unittest . mock import MagicMock , patch <EOL> except ImportError : <EOL> from mock import MagicMock , patch <EOL> class FakeTestRunner ( object ) : <EOL> """<STR_LIT>""" <EOL> def setup_test_environment ( self ) : <EOL> pass <EOL> def teardown_test_environment ( self ) : <EOL> pass <EOL> class Runner ( runner . CIRunner , FakeTestRunner ) : <EOL> """<STR_LIT>""" <EOL> pass <EOL> class TestCIRunner ( TestCase ) : <EOL> def test_get_tasks ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( runner . get_tasks ( ) , <EOL> [ tasks . with_coverage . CoverageTask , <EOL> tasks . run_pylint . PyLintTask , <EOL> tasks . run_flake8 . Flake8Task , <EOL> tasks . run_jshint . JSHintTask , <EOL> tasks . run_sloccount . SlocCountTask ] ) <EOL> @ skipIf ( django . VERSION >= ( <NUM_LIT:1> , <NUM_LIT:8> ) , "<STR_LIT>" ) <EOL> def test_get_task_options ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( len ( runner . get_task_options ( ) ) , <NUM_LIT:20> ) <EOL> def test_setup_test_environment ( self ) : <EOL> """<STR_LIT>""" <EOL> mock_task = MagicMock ( ) <EOL> with patch . object ( Runner , '<STR_LIT>' ) as mock_init : <EOL> mock_init . return_value = None <EOL> cirun = Runner ( ) <EOL> cirun . jenkins = True <EOL> cirun . tasks = [ mock_task ] <EOL> cirun . setup_test_environment ( ) <EOL> self . assertTrue ( mock_task . setup_test_environment . called ) <EOL> def test_teardown_test_environment ( self ) : <EOL> """<STR_LIT>""" <EOL> mock_task = MagicMock ( ) <EOL> with patch . object ( Runner , '<STR_LIT>' ) as mock_init : <EOL> mock_init . return_value = None <EOL> cirun = Runner ( ) <EOL> cirun . jenkins = True <EOL> cirun . tasks = [ mock_task ] <EOL> cirun . teardown_test_environment ( ) <EOL> self . assertTrue ( mock_task . teardown_test_environment . called ) </s>
