示例#1
0
文件: concretize.py 项目: zepx/spack
 def test_find_spec_children(self):
     s = Spec('a', Spec('b +foo', Spec('c'), Spec('d +foo')),
              Spec('e +foo'))
     assert 'd' == find_spec(s['b'], lambda s: '+foo' in s).name
     s = Spec('a', Spec('b +foo', Spec('c +foo'), Spec('d')),
              Spec('e +foo'))
     assert 'c' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#2
0
文件: concretize.py 项目: LLNL/spack
    def test_find_spec_sibling(self):

        s = Spec.from_literal({
            'a': {
                'b +foo': {
                    'c': None,
                    'd': None
                },
                'e +foo': None
            }
        })

        assert 'e' == find_spec(s['b'], lambda s: '+foo' in s).name
        assert 'b' == find_spec(s['e'], lambda s: '+foo' in s).name

        s = Spec.from_literal({
            'a': {
                'b +foo': {
                    'c': None,
                    'd': None
                },
                'e': {
                    'f +foo': None
                }
            }
        })

        assert 'f' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#3
0
    def test_find_spec_sibling(self):

        s = Spec.from_literal({
            'a': {
                'b +foo': {
                    'c': None,
                    'd': None
                },
                'e +foo': None
            }
        })

        assert 'e' == find_spec(s['b'], lambda s: '+foo' in s).name
        assert 'b' == find_spec(s['e'], lambda s: '+foo' in s).name

        s = Spec.from_literal({
            'a': {
                'b +foo': {
                    'c': None,
                    'd': None
                },
                'e': {
                    'f +foo': None
                }
            }
        })

        assert 'f' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#4
0
 def test_find_spec_children(self):
     s = Spec('a', Spec('b +foo', Spec('c'), Spec('d +foo')),
              Spec('e +foo'))
     self.assertEqual('d', find_spec(s['b'], lambda s: '+foo' in s).name)
     s = Spec('a', Spec('b +foo', Spec('c +foo'), Spec('d')),
              Spec('e +foo'))
     self.assertEqual('c', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#5
0
    def test_find_spec_sibling(self):
        s = Spec('a', Spec('b +foo', Spec('c'), Spec('d')), Spec('e +foo'))
        self.assertEqual('e', find_spec(s['b'], lambda s: '+foo' in s).name)
        self.assertEqual('b', find_spec(s['e'], lambda s: '+foo' in s).name)

        s = Spec('a', Spec('b +foo', Spec('c'), Spec('d')),
                 Spec('e', Spec('f +foo')))
        self.assertEqual('f', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#6
0
文件: concretize.py 项目: zepx/spack
    def test_find_spec_sibling(self):
        s = Spec('a', Spec('b +foo', Spec('c'), Spec('d')), Spec('e +foo'))
        assert 'e' == find_spec(s['b'], lambda s: '+foo' in s).name
        assert 'b' == find_spec(s['e'], lambda s: '+foo' in s).name

        s = Spec('a', Spec('b +foo', Spec('c'), Spec('d')),
                 Spec('e', Spec('f +foo')))
        assert 'f' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#7
0
 def test_find_spec_children(self):
     s = Spec('a',
              Spec('b +foo',
                   Spec('c'),
                   Spec('d +foo')),
              Spec('e +foo'))
     self.assertEqual('d', find_spec(s['b'], lambda s: '+foo' in s).name)
     s = Spec('a',
              Spec('b +foo',
                   Spec('c +foo'),
                   Spec('d')),
              Spec('e +foo'))
     self.assertEqual('c', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#8
0
 def test_find_spec_children(self):
     s = Spec('a',
              Spec('b +foo',
                   Spec('c'),
                   Spec('d +foo')),
              Spec('e +foo'))
     assert 'd' == find_spec(s['b'], lambda s: '+foo' in s).name
     s = Spec('a',
              Spec('b +foo',
                   Spec('c +foo'),
                   Spec('d')),
              Spec('e +foo'))
     assert 'c' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#9
0
 def test_find_spec_none(self):
     s = Spec('a',
              Spec('b',
                   Spec('c'),
                   Spec('d')),
              Spec('e'))
     self.assertEqual(None, find_spec(s['b'], lambda s: '+foo' in s))
示例#10
0
 def test_find_spec_none(self):
     s = Spec('a',
              Spec('b',
                   Spec('c'),
                   Spec('d')),
              Spec('e'))
     assert find_spec(s['b'], lambda s: '+foo' in s) is None
示例#11
0
    def test_find_spec_sibling(self):
        s = Spec('a',
                 Spec('b +foo',
                      Spec('c'),
                      Spec('d')),
                 Spec('e +foo'))
        self.assertEqual('e', find_spec(s['b'], lambda s: '+foo' in s).name)
        self.assertEqual('b', find_spec(s['e'], lambda s: '+foo' in s).name)

        s = Spec('a',
                 Spec('b +foo',
                      Spec('c'),
                      Spec('d')),
                 Spec('e',
                      Spec('f +foo')))
        self.assertEqual('f', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#12
0
    def test_find_spec_sibling(self):
        s = Spec('a',
                 Spec('b +foo',
                      Spec('c'),
                      Spec('d')),
                 Spec('e +foo'))
        assert 'e' == find_spec(s['b'], lambda s: '+foo' in s).name
        assert 'b' == find_spec(s['e'], lambda s: '+foo' in s).name

        s = Spec('a',
                 Spec('b +foo',
                      Spec('c'),
                      Spec('d')),
                 Spec('e',
                      Spec('f +foo')))
        assert 'f' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#13
0
 def test_find_spec_self(self):
     s = Spec('a',
              Spec('b +foo',
                   Spec('c'),
                   Spec('d')),
              Spec('e'))
     assert 'b' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#14
0
 def test_find_spec_self(self):
     s = Spec('a',
              Spec('b +foo',
                   Spec('c'),
                   Spec('d')),
              Spec('e'))
     self.assertEqual('b', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#15
0
    def test_find_spec_parents(self):
        """Tests the spec finding logic used by concretization. """
        s = Spec('a +foo',
                 Spec('b +foo',
                      Spec('c'),
                      Spec('d +foo')),
                 Spec('e +foo'))

        self.assertEqual('a', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#16
0
 def test_find_spec_none(self):
     s = Spec.from_literal({
         'a': {
             'b': {
                 'c': None,
                 'd': None
             },
             'e': None
         }
     })
     assert find_spec(s['b'], lambda s: '+foo' in s) is None
示例#17
0
文件: concretize.py 项目: LLNL/spack
 def test_find_spec_none(self):
     s = Spec.from_literal({
         'a': {
             'b': {
                 'c': None,
                 'd': None
             },
             'e': None
         }
     })
     assert find_spec(s['b'], lambda s: '+foo' in s) is None
示例#18
0
    def test_find_spec_parents(self):
        """Tests the spec finding logic used by concretization. """
        s = Spec.from_literal(
            {'a +foo': {
                'b +foo': {
                    'c': None,
                    'd+foo': None
                },
                'e +foo': None
            }})

        assert 'a' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#19
0
文件: concretize.py 项目: LLNL/spack
    def test_find_spec_parents(self):
        """Tests the spec finding logic used by concretization. """
        s = Spec.from_literal({
            'a +foo': {
                'b +foo': {
                    'c': None,
                    'd+foo': None
                },
                'e +foo': None
            }
        })

        assert 'a' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#20
0
    def test_find_spec_children(self):
        s = Spec.from_literal(
            {'a': {
                'b +foo': {
                    'c': None,
                    'd+foo': None
                },
                'e +foo': None
            }})

        assert 'd' == find_spec(s['b'], lambda s: '+foo' in s).name

        s = Spec.from_literal(
            {'a': {
                'b +foo': {
                    'c+foo': None,
                    'd': None
                },
                'e +foo': None
            }})

        assert 'c' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#21
0
文件: concretize.py 项目: LLNL/spack
    def test_find_spec_children(self):
        s = Spec.from_literal({
            'a': {
                'b +foo': {
                    'c': None,
                    'd+foo': None
                },
                'e +foo': None
            }
        })

        assert 'd' == find_spec(s['b'], lambda s: '+foo' in s).name

        s = Spec.from_literal({
            'a': {
                'b +foo': {
                    'c+foo': None,
                    'd': None
                },
                'e +foo': None
            }
        })

        assert 'c' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#22
0
 def test_find_spec_self(self):
     s = Spec('a', Spec('b +foo', Spec('c'), Spec('d')), Spec('e'))
     self.assertEqual('b', find_spec(s['b'], lambda s: '+foo' in s).name)
示例#23
0
 def test_find_spec_none(self):
     s = Spec('a', Spec('b', Spec('c'), Spec('d')), Spec('e'))
     self.assertEqual(None, find_spec(s['b'], lambda s: '+foo' in s))
示例#24
0
文件: concretize.py 项目: zepx/spack
 def test_find_spec_self(self):
     s = Spec('a', Spec('b +foo', Spec('c'), Spec('d')), Spec('e'))
     assert 'b' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#25
0
文件: concretize.py 项目: zepx/spack
    def test_find_spec_parents(self):
        """Tests the spec finding logic used by concretization. """
        s = Spec('a +foo', Spec('b +foo', Spec('c'), Spec('d +foo')),
                 Spec('e +foo'))

        assert 'a' == find_spec(s['b'], lambda s: '+foo' in s).name
示例#26
0
文件: concretize.py 项目: zepx/spack
 def test_find_spec_none(self):
     s = Spec('a', Spec('b', Spec('c'), Spec('d')), Spec('e'))
     assert find_spec(s['b'], lambda s: '+foo' in s) is None