def test_unresolvable(self): # Check there is no "defaults" being used. We assume that Python will # always be available in defaults. with self.env_spec_fh(""" channels: [] env: - python """) as specfile: with self.assertRaises(NoPackagesFound): pkgs = resolve_spec(specfile)
def test_unresolvable(self): # Check there is no "defaults" being used. We assume that Python will # always be available in defaults. with self.env_spec_fh(""" channels: [] env: - python """) as specfile: with self.assertRaises(conda.resolve.NoPackagesFound): pkgs = resolve_spec(specfile)
def test(self): # Check that resolve_spec is returning the expected content. index = dummy_index.DummyIndex() index.add_pkg('foo', '2.7.0', depends=('bar', ), build_number=0) index.add_pkg('foo', '3.5.0', depends=('bar', ), build_number=0) index.add_pkg('bar', '1.2', build_number=0) with tempdir() as tmp: channel = index.write_to_channel(tmp) with self.env_spec_fh(""" channels: - file://{} env: - foo """.format(tmp)) as specfile: pkgs = resolve_spec(specfile) pkg_names = [line.split('\t')[-1] for line in pkgs] self.assertEqual(sorted(pkg_names), ['bar-1.2-0', 'foo-3.5.0-0'])
def test(self): # Check that resolve_spec is returning the expected content. index = dummy_index.DummyIndex() index.add_pkg('foo', '2.7.0', depends=('bar',)) index.add_pkg('foo', '3.5.0', depends=('bar',)) index.add_pkg('bar', '1.2') with tempdir() as tmp: channel = index.write_to_channel(tmp) with self.env_spec_fh(""" channels: - file://{} env: - foo """.format(tmp)) as specfile: pkgs = resolve_spec(specfile) pkg_names = [line.split('\t')[-1] for line in pkgs] self.assertEqual(sorted(pkg_names), ['bar-1.2-0', 'foo-3.5.0-0'])