Exemple #1
0
    def test_run_exits(self, main):
        d = Distribution({"script_name": "setup.py", "script_args": ["green"]})

        cmd = command.green(d)
        with self.assertRaises(SystemExit) as se:
            cmd.run()
        self.assertEqual(se.exception.code, 125)
Exemple #2
0
    def test_run_exits(self, main):
        d = Distribution({'script_name': 'setup.py', 'script_args': ['green']})

        cmd = command.green(d)
        with self.assertRaises(SystemExit) as se:
            cmd.run()
        self.assertEqual(se.exception.code, 125)
Exemple #3
0
    def test_initialize_options(self):
        d =  Distribution({'script_name': 'setup.py',
                           'script_args': ['green']})

        cmd = command.green(d)
        for attr in ['completion_file', 'clear_omit', 'debug', 'processes']:
            self.assertTrue(hasattr(cmd, attr), attr)
Exemple #4
0
    def test_run_exits(self, main):
        d =  Distribution({'script_name': 'setup.py',
                           'script_args': ['green']})

        cmd = command.green(d)
        with self.assertRaises(SystemExit) as se:
            cmd.run()
        self.assertEqual(se.exception.code, 125)
Exemple #5
0
    def test_run(self, main):
        d =  Distribution({'script_name': 'setup.py',
                           'script_args': ['green'],
                           'test_suite': 'green.test.test_version'})

        cmd = command.green(d)
        cmd.run()
        main.assert_called_once_with(['green.test.test_version'])
Exemple #6
0
    def test_run(self, main):
        d = Distribution({
            "script_name": "setup.py",
            "script_args": ["green"],
            "test_suite": "green.test.test_version",
        })

        cmd = command.green(d)
        cmd.run()
        main.assert_called_once_with(["green.test.test_version"])
Exemple #7
0
    def test_requires(self, main):
        d = Distribution({'script_name': 'setup.py',
                          'script_args': ['green'],
                          'install_requires': ['six'],
                          'tests_require': ['mock', 'unittest2']})
        d.fetch_build_eggs = MagicMock()
        cmd = command.green(d)
        cmd.run()

        d.fetch_build_eggs.assert_has_calls([
            call(['six']),
            call(['mock', 'unittest2']),
        ])
Exemple #8
0
    def test_requires(self, main):
        d = Distribution({
            "script_name": "setup.py",
            "script_args": ["green"],
            "install_requires": ["six"],
            "tests_require": ["mock", "unittest2"],
        })
        d.fetch_build_eggs = MagicMock()
        cmd = command.green(d)
        cmd.run()

        d.fetch_build_eggs.assert_has_calls([
            call(["six"]),
            call(["mock", "unittest2"]),
        ])
Exemple #9
0
    def test_initialize_options(self):
        d = Distribution({"script_name": "setup.py", "script_args": ["green"]})

        cmd = command.green(d)
        for attr in ["completion_file", "clear_omit", "debug", "processes"]:
            self.assertTrue(hasattr(cmd, attr), attr)