Ejemplo n.º 1
0
    def test_upgrade_fail(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")

        scipy_0_17_1 = P(
            u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")

        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            scipy_0_17_1
        ])
        self.installed_repository.update(
            [mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])

        r_hint_pretty_string = textwrap.dedent(u"""\
            The following jobs are conflicting:
                install mkl == 2017.0.1-2
                install numpy == 1.10.4-1""")

        # When/Then
        request = Request()
        request.upgrade()

        with self.assertRaises(SatisfiabilityErrorWithHint) as ctx:
            self.resolve_with_hint(request)

        self.assertMultiLineEqual(ctx.exception.hint_pretty_string,
                                  r_hint_pretty_string)
Ejemplo n.º 2
0
    def test_upgrade_fail(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")

        scipy_0_17_1 = P(u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")

        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            scipy_0_17_1
        ])
        self.installed_repository.update([mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])

        r_hint_pretty_string = textwrap.dedent(u"""\
            The following jobs are conflicting:
                install mkl == 2017.0.1-2
                install numpy == 1.10.4-1"""
        )

        # When/Then
        request = Request()
        request.upgrade()

        with self.assertRaises(SatisfiabilityErrorWithHint) as ctx:
            self.resolve_with_hint(request)

        self.assertMultiLineEqual(
            ctx.exception.hint_pretty_string, r_hint_pretty_string)
Ejemplo n.º 3
0
    def test_upgrade_no_candidate(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")

        scipy_0_17_1 = P(
            u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")

        gnureadline_6_3 = P(u"gnureadline 6.3-1")

        # gnureadline is not available in the remote repository
        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            scipy_0_17_1
        ])
        self.installed_repository.update(
            [mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])
        self.installed_repository.update([gnureadline_6_3])

        # When/Then
        request = Request()
        request.upgrade()

        with self.assertRaises(SatisfiabilityError):
            self.resolve(request)
Ejemplo n.º 4
0
    def test_upgrade_no_candidate(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")

        scipy_0_17_1 = P(u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")

        gnureadline_6_3 = P(u"gnureadline 6.3-1")

        # gnureadline is not available in the remote repository
        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            scipy_0_17_1
        ])
        self.installed_repository.update([mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])
        self.installed_repository.update([gnureadline_6_3])

        # When/Then
        request = Request()
        request.upgrade()

        with self.assertRaises(SatisfiabilityError):
            self.resolve(request)
Ejemplo n.º 5
0
    def test_upgrade_simple(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")
        numpy_1_11_3 = P(u"numpy 1.11.3-1; depends (mkl ^= 2017.0.1)")

        scipy_0_17_1 = P(u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")
        scipy_0_18_1 = P(u"scipy 0.18.1-1; depends (mkl ^= 2017.0.1, numpy ^= 1.11.3)")

        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            numpy_1_11_3, scipy_0_17_1, scipy_0_18_1
        ])
        self.installed_repository.update([mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])

        r_operations = [
            RemoveOperation(scipy_0_17_1),
            RemoveOperation(numpy_1_10_4),
            RemoveOperation(mkl_11_3_1),
            InstallOperation(mkl_2017_0_1_2),
            InstallOperation(numpy_1_11_3),
            InstallOperation(scipy_0_18_1),
        ]

        # When
        request = Request()
        request.upgrade()

        transaction = self.resolve(request)

        # Then
        self.assertEqualOperations(transaction.operations, r_operations)
Ejemplo n.º 6
0
    def test_upgrade_fail(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")

        scipy_0_17_1 = P(u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")

        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            scipy_0_17_1
        ])
        self.installed_repository.update([mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])

        # When/Then
        request = Request()
        request.upgrade()

        with self.assertRaises(SatisfiabilityError):
            self.resolve(request)
Ejemplo n.º 7
0
    def test_upgrade_simple(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")
        numpy_1_11_3 = P(u"numpy 1.11.3-1; depends (mkl ^= 2017.0.1)")

        scipy_0_17_1 = P(
            u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")
        scipy_0_18_1 = P(
            u"scipy 0.18.1-1; depends (mkl ^= 2017.0.1, numpy ^= 1.11.3)")

        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            numpy_1_11_3, scipy_0_17_1, scipy_0_18_1
        ])
        self.installed_repository.update(
            [mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])

        r_operations = [
            RemoveOperation(scipy_0_17_1),
            RemoveOperation(numpy_1_10_4),
            RemoveOperation(mkl_11_3_1),
            InstallOperation(mkl_2017_0_1_2),
            InstallOperation(numpy_1_11_3),
            InstallOperation(scipy_0_18_1),
        ]

        # When
        request = Request()
        request.upgrade()

        transaction = self.resolve(request)

        # Then
        self.assertEqualOperations(transaction.operations, r_operations)
Ejemplo n.º 8
0
    def test_upgrade_fail(self):
        # Given
        mkl_11_3_1 = P(u"mkl 11.3.1-1")
        mkl_2017_0_1_1 = P(u"mkl 2017.0.1-1")
        mkl_2017_0_1_2 = P(u"mkl 2017.0.1-2")

        numpy_1_10_4 = P(u"numpy 1.10.4-1; depends (mkl ^= 11.3.1)")

        scipy_0_17_1 = P(
            u"scipy 0.17.1-1; depends (mkl ^= 11.3.1, numpy ^= 1.10.4)")

        self.repository.update([
            mkl_11_3_1, mkl_2017_0_1_1, mkl_2017_0_1_2, numpy_1_10_4,
            scipy_0_17_1
        ])
        self.installed_repository.update(
            [mkl_11_3_1, numpy_1_10_4, scipy_0_17_1])

        # When/Then
        request = Request()
        request.upgrade()

        with self.assertRaises(SatisfiabilityError):
            self.resolve(request)