Example #1
0
    def test_plugin_defaults_to_cwd(self):
        """
        Running the plugins tests defaults to the current working directory.
        """
        plugin_dir = create_plugin(
            mkdtemp(), template='python',
            bundle='bundle', name='name')

        expectation = Expectation((1, 2), None, u'aaa')
        results = [
            SuccessResult(
                actual=u'aaa', expectation=expectation,
                plugin=MockPlugin())]

        with patch('jig.commands.plugin.PluginTestRunner') as ptr:
            ptr.return_value = Mock()
            ptr.return_value.run = Mock(return_value=results)

            with cwd_bounce(plugin_dir):
                self.run_command('test')

        self.assertResults(
            u'''
            01 – 02 Pass

            Pass 1, Fail 0''', self.output)
Example #2
0
    def test_plugin_defaults_to_cwd(self):
        """
        Running the plugins tests defaults to the current working directory.
        """
        plugin_dir = create_plugin(mkdtemp(),
                                   template='python',
                                   bundle='bundle',
                                   name='name')

        expectation = Expectation((1, 2), None, u'aaa')
        results = [
            SuccessResult(actual=u'aaa',
                          expectation=expectation,
                          plugin=MockPlugin())
        ]

        with patch('jig.commands.plugin.PluginTestRunner') as ptr:
            ptr.return_value = Mock()
            ptr.return_value.run = Mock(return_value=results)

            with cwd_bounce(plugin_dir):
                self.run_command('test')

        self.assertResults(
            u'''
            01 – 02 Pass

            Pass 1, Fail 0''', self.output)
Example #3
0
    def test_create_plugin(self):
        """
        Can create a plugin.
        """
        with cwd_bounce(self.plugindir):
            self.run_command('create name bundle')

        self.assertTrue(isdir(join(self.plugindir, 'name')))
        self.assertTrue(isfile(join(self.plugindir, 'name', 'config.cfg')))
Example #4
0
    def test_create_plugin(self):
        """
        Can create a plugin.
        """
        with cwd_bounce(self.plugindir):
            self.run_command('create name bundle')

        self.assertTrue(isdir(join(self.plugindir, 'name')))
        self.assertTrue(isfile(join(self.plugindir, 'name', 'config.cfg')))