

def test_expand_schema_spec(self):
    ' Test the expand_schema_spec()\n\n            The _expand_schema_spec() function is used throughout the schema\n            functions to expand the schema specification input and so we test\n            the separately.\n        '
    self.assertRaises(NipapInputError, self.nipap._expand_schema_spec, 'string')
    self.assertRaises(NipapInputError, self.nipap._expand_schema_spec, 1)
    self.assertRaises(NipapInputError, self.nipap._expand_schema_spec, [])
    self.assertRaises(NipapMissingInputError, self.nipap._expand_schema_spec, {
        
    })
    self.assertRaises(NipapExtraneousInputError, self.nipap._expand_schema_spec, {
        'crap': self.schema_attrs['name'],
    })
    self.assertRaises(NipapExtraneousInputError, self.nipap._expand_schema_spec, {
        'name': self.schema_attrs['name'],
        'crap': 'crap',
    })
    self.assertRaises(NipapValueError, self.nipap._expand_schema_spec, {
        'id': '3',
    })
    self.assertRaises(NipapValueError, self.nipap._expand_schema_spec, {
        'name': 3,
    })
    self.assertRaises(NipapExtraneousInputError, self.nipap._expand_schema_spec, {
        'id': 3,
        'name': '3',
    })
    (where, params) = self.nipap._expand_schema_spec({
        'id': 3,
    })
    self.assertEqual(where, 'id = %(spec_id)s', 'Improperly expanded WHERE clause')
    self.assertEqual(params, {
        'spec_id': 3,
    }, 'Improperly expanded params dict')
    (where, params) = self.nipap._expand_schema_spec({
        'name': 'test',
    })

dataset/ETHPy150Open SpriteLink/NIPAP/tests/nipapbase.py NipapTest.test_expand_schema_spec/original