def setUp(self):
        if TestingGitWithDefaultParameters.identifier not in ADDITIONAL_COMMANDS:
            ADDITIONAL_COMMANDS[TestingGitWithDefaultParameters.identifier] = TestingGitWithDefaultParameters

        self.command = get_command('cthulhubot-git')()
        self.sub_command = get_command('cthulhubot-test-git-defaulted')()

        self.repository_uri = '/tmp/repo.git'
        self.project = Project(name='test', slug='test', tracker_uri='http://example.com', repository_uri=self.repository_uri)
Example #2
0
    def get_command_class(self):
        if not self._command:
            self._command = get_command(slug=self.slug)()
            if not self._command:
                raise ValueError(u"Command %s cannot be resolved" % self.slug)

        return self._command
    def test_discovery_of_unconfigured_packages_finding_configured_and_unconfigured(self):
        slug = 'cthulhubot-debian-build-debian-package'
        cmd = get_command(slug)()
        Command.objects.create(slug=cmd.identifier)

        unconfigured_slug = 'cthulhubot-django-unit-test-config'

        commands = get_undiscovered_commands()

        self.assert_equals(None, commands.get(cmd.identifier))
        self.assert_equals(unconfigured_slug, commands.get(unconfigured_slug).identifier)
    def setUp(self):
        super(TestUpdateRepositoryInformation, self).setUp()
        self.command = get_command('cthulhubot-update-repository-info')()

        self.mongo_config = {
            "host" : "host",
            "port" : 20000,
            "username" : "user",
            "password" : "heslo",
            "database_name" : "db",
        }

        self.project = Mock()
        self.project.repository_uri = '/tmp/repo.git'

        self.original_config = {}

        self._mock_mongo_settings()
    def test_git_repository_uri_propagation(self):
        cmd = get_command('cthulhubot-git')()
        cmd.update_config(config={'repository' : '/tmp/repo'})

        self.assert_equals('/tmp/repo', cmd.get_buildbot_command().repourl)
 def test_debian_package_creator_discovered(self):
     # aka basic discovering
     command = get_command('cthulhubot-debian-build-debian-package')
     self.assert_true(command is not None)
    def test_database_association(self):
        cmd = get_command('cthulhubot-debian-build-debian-package')()
        command = Command.objects.create(slug=cmd.identifier)

        self.assert_equals(command.get_command(), cmd.get_command())
    def test_unconfigured_parameters_found(self):
        cmd = get_command('cthulhubot-debian-package-ftp-upload')()

        self.assert_equals(4, len(cmd.get_unconfigured_parameters()))
    def test_discovery_of_unconfigured_packages_misses_configured_ones(self):
        cmd = get_command('cthulhubot-debian-build-debian-package')()
        Command.objects.create(slug=cmd.identifier)

        commands = get_undiscovered_commands()
        assert cmd.identifier not in commands
 def test_sleep_discovered(self):
     assert get_command('cthulhubot-sleep') is not None
 def test_build_and_unit_discovered(self):
     assert get_command('cthulhubot-debian-build-debian-package') is not None
     assert get_command('cthulhubot-django-unit-test-config') is not None