Exemple #1
0
    def test_get_no_files_in_repo(self):
        # given
        dependabot = Dependabot(ANY, ANY)

        # when
        package_managers = dependabot.get_package_managers([])

        # then
        assert package_managers == set([])
Exemple #2
0
    def test_get_gradle_package_manager(self):
        # given
        mock_content = {'name': 'build.gradle'}

        dependabot = Dependabot(ANY, ANY)

        # when
        package_managers = dependabot.get_package_managers([mock_content])

        # then
        assert package_managers == set(['gradle'])
Exemple #3
0
    def test_get_maven_package_manager(self):
        # given
        mock_content = {'name': 'pom.xml'}

        dependabot = Dependabot(ANY, ANY)

        # when
        package_managers = dependabot.get_package_managers([mock_content])

        # then
        assert package_managers == set(['maven'])
Exemple #4
0
    def test_get_package_managers(self):
        # given
        mock_content = {'name': 'Dockerfile'}

        dependabot = Dependabot(ANY, ANY)

        # when
        package_managers = dependabot.get_package_managers([mock_content])

        # then
        assert package_managers == set(['docker'])
Exemple #5
0
    def test_get_multiple_package_managers(self):
        # given
        mock_dockerfile = {'name': 'Dockerfile'}
        mock_pipfile = {'name': 'Pipfile'}

        dependabot = Dependabot(ANY, ANY)

        # when
        package_managers = dependabot.get_package_managers(
            [mock_dockerfile, mock_pipfile])

        # then
        assert package_managers == set(['docker', 'pip'])