Beispiel #1
0
    def test_find_conflicts_called_once(self):
        bad_deps = {
            'python':
            {((MatchSpec("statistics"),
               MatchSpec("python[version='>=2.7,<2.8.0a0']")), 'python=3')}
        }

        with patch('conda.resolve.Resolve.find_conflicts') as monkey:
            monkey.side_effect = UnsatisfiableError(bad_deps, strict=True)
            with self.assertRaises(UnsatisfiableError):
                # Statistics is a py27 only package allowing us a simple unsatisfiable case
                stdout, stderr, _ = run_command(Commands.INSTALL, self.prefix,
                                                'statistics')
            self.assertEqual(monkey.call_count, 1)
            monkey.reset_mock()
            with self.assertRaises(UnsatisfiableError):
                stdout, stderr, _ = run_command(Commands.INSTALL, self.prefix,
                                                'statistics',
                                                '--freeze-installed')
            self.assertEqual(monkey.call_count, 1)
            monkey.reset_mock()
            with self.assertRaises(UnsatisfiableError):
                stdout, stderr, _ = run_command(Commands.CREATE, self.testenv,
                                                'statistics', 'python=3.7')
            self.assertEqual(monkey.call_count, 1)
Beispiel #2
0
    def test_search_3(self):
        from tests.test_create import make_temp_env
        from tests.test_create import run_command
        from tests.test_create import Commands
        with make_temp_env() as prefix:
            stdout, stderr = run_command(Commands.SEARCH,
                                         prefix,
                                         "nose",
                                         "--info",
                                         use_exception_handler=True)
            result = stdout.replace("Loading channels: ...working... done", "")

            assert """
                    nose 1.3.0 py33_0
                    -----------------
                    file name   : nose-1.3.0-py33_0.tar.bz2
                    name        : nose
                    version     : 1.3.0
                    build string: py33_0
                    build number: 0
                    size        : 199 KB
                    arch        : x86_64
                    constrains  : ()
                    platform    : Platform.osx
                    license     : LGPL
                    subdir      : osx-64
                    url         : https://repo.continuum.io/pkgs/free/osx-64/nose-1.3.0-py33_0.tar.bz2
                    dependencies:
                      - python 3.3*
                    """.dals() in result

            print(result)
Beispiel #3
0
    def test_search_2(self):
        from tests.test_create import make_temp_env
        from tests.test_create import run_command
        from tests.test_create import Commands
        with make_temp_env() as prefix:
            stdout, stderr, _ = run_command(Commands.SEARCH, prefix, "nose", use_exception_handler=True)
            result = stdout.replace("Loading channels: ...working... done", "")

            assert "nose                           1.3.4          py34_0  pkgs/free" in result
Beispiel #4
0
    def test_search_2(self):
        from tests.test_create import make_temp_env
        from tests.test_create import run_command
        from tests.test_create import Commands
        with make_temp_env() as prefix:
            stdout, stderr, _ = run_command(Commands.SEARCH, prefix, "nose", use_exception_handler=True)
            result = stdout.replace("Loading channels: ...working... done", "")

            assert "nose                           1.3.7          py37_2  pkgs/main" in result
Beispiel #5
0
 def test_search_3(self):
     from tests.test_create import make_temp_env
     from tests.test_create import run_command
     from tests.test_create import Commands
     with make_temp_env() as prefix:
         stdout, stderr, _ = run_command(Commands.SEARCH, prefix, "*/linux-64::nose==1.3.7[build=py37_2]", "--info", use_exception_handler=True)
         result = stdout.replace("Loading channels: ...working... done", "")
         assert "file name   : nose-1.3.7-py37_2.conda" in result
         assert "name        : nose" in result
         assert "url         : https://repo.anaconda.com/pkgs/main/linux-64/nose-1.3.7-py37_2.conda" in result
Beispiel #6
0
 def test_search_3(self):
     from tests.test_create import make_temp_env
     from tests.test_create import run_command
     from tests.test_create import Commands
     with make_temp_env() as prefix:
         stdout, stderr, _ = run_command(Commands.SEARCH, prefix, "*/linux-64::nose==1.3.7[build=py36_1]", "--info", use_exception_handler=True)
         result = stdout.replace("Loading channels: ...working... done", "")
         assert "file name   : nose-1.3.7-py36_1.tar.bz2" in result
         assert "name        : nose" in result
         assert "url         : https://repo.anaconda.com/pkgs/free/linux-64/nose-1.3.7-py36_1.tar.bz2" in result
         assert "md5         : f4f697f5ad4df9c8fe35357d269718a5" in result
Beispiel #7
0
 def test_search_3(self):
     from tests.test_create import make_temp_env
     from tests.test_create import run_command
     from tests.test_create import Commands
     with make_temp_env() as prefix:
         stdout, stderr, _ = run_command(Commands.SEARCH, prefix, "*/linux-64::nose==1.3.7[build=py37_2]", "--info", use_exception_handler=True)
         result = stdout.replace("Loading channels: ...working... done", "")
         assert "file name   : nose-1.3.7-py37_2.tar.bz2" in result
         assert "name        : nose" in result
         assert "url         : https://repo.anaconda.com/pkgs/main/linux-64/nose-1.3.7-py37_2.tar.bz2" in result
         assert "md5         : ff390a1e44d77e54914ca1a2c9e75445" in result
Beispiel #8
0
 def test_search_3(self):
     from tests.test_create import make_temp_env
     from tests.test_create import run_command
     from tests.test_create import Commands
     with make_temp_env() as prefix:
         stdout, stderr = run_command(
             Commands.SEARCH,
             prefix,
             "*/linux-64::nose==1.3.7[build=py36_1]",
             "--info",
             use_exception_handler=True)
         result = stdout.replace("Loading channels: ...working... done", "")
         assert "file name   : nose-1.3.7-py36_1.tar.bz2" in result
         assert "name        : nose" in result
         assert "url         : https://repo.anaconda.com/pkgs/free/linux-64/nose-1.3.7-py36_1.tar.bz2" in result
         assert "md5         : f4f697f5ad4df9c8fe35357d269718a5" in result
Beispiel #9
0
 def setUp(self):
     self.prefix = tempfile.mkdtemp()
     self.testenv = tempfile.mkdtemp()
     run_command(Commands.CREATE, self.prefix, 'python=3.7')