def test_smart_search_asn(self):

        attr = {
            'asn': 5,
            'name': 'Autonomous System Number 5'
        }

        asn = s.add_asn({ 'auth': ad, 'attr': attr })
        res = s.smart_search_asn({ 'auth': ad, 'query_string': "Autonomous" })
        self.assertEquals(len(res['result']), 1, "search resulted in wrong number of hits")
        self.assertEquals(res['result'][0]['asn'], attr['asn'], "search hit got wrong asn")
        self.assertEquals(res['interpretation']['interpretation']['attribute'], 'name', 'search term interpreted as wrong type')

        res = s.smart_search_asn({ 'auth': ad, 'query_string': "5" })
        self.assertEquals(len(res['result']), 1, "search resulted in wrong number of hits")
        self.assertEquals(res['result'][0]['asn'], attr['asn'], "search hit got wrong asn")
        self.assertEquals(res['interpretation']['interpretation']['attribute'], 'asn', "search term interpretated as wrong type")
Test smart_search_asn function.
dataset/ETHPy150Open SpriteLink/NIPAP/tests/xmlrpc.py/NipapXmlTest.test_smart_search_asn