def test_node_response(self): node = StatNode() node.load_query("query") resp = node.response() stat = [ int(word) for word in resp.split() if word.replace('.', '').isdigit() ] self.assertTrue(isinstance(resp, str))
def test_extract_stat(self): node = StatNode() node.load_query("What is Kobe Bryant's true shooting percentage?") stat = node.extract_stat() self.assertEqual(stat, "true shooting percentage")
def test_extract_name(self): node = StatNode() node.load_query("What is Kobe Bryant's shooting percentage?") name = node.extract_name() self.assertEqual(name, "Kobe Bryant's")