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
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
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)
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)
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
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))
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
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
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)
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)
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
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
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
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
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
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