def testMirror(self): odata = sesame.resolve("NGC4258", mirror="cds") self.assertTrue(odata is not None) self.assertTrue(odata.resolver_name.startswith("S=Simbad")) self.assertEquals("M 106", odata.oname) self.assertTrue("otype" in odata.keys()) odata = sesame.resolve("NGC4258", mirror="cfa") self.assertTrue(odata is not None) self.assertTrue(odata.resolver_name.startswith("S=Simbad")) self.assertEquals("M 106", odata.oname) self.assertTrue("otype" in odata.keys()) self.assertRaises(LookupError, sesame.resolve, "NGC4258", mirror="ncsa")
def testDefault(self): odata = sesame.resolve("NGC4258") self.assertTrue(odata is not None) self.assertFalse(isinstance(odata, list)) self.assertTrue(odata.resolver_name.startswith("S=Simbad")) self.assertEquals("M 106", odata.oname) self.assertTrue("otype" in odata.keys()) odata = sesame.resolve(["NGC4258", "M51"]) self.assertTrue(odata is not None) self.assertTrue(isinstance(odata, list)) self.assertTrue(odata[1].resolver_name.startswith("S=Simbad")) self.assertEquals("M 106", odata[0].oname) self.assertEquals("M 51", odata[1].oname) self.assertTrue("otype" in odata[0].keys()) self.assertTrue("otype" in odata[1].keys())
def testInclude(self): odata = sesame.resolve("NGC4258", include=" aliases fluxes") self.assertTrue(odata is not None) self.assertFalse(isinstance(odata, list)) self.assertTrue("alias" in odata.keys()) self.assertTrue(len(odata.aliases) > 0) odata = sesame.resolve("NGC4258", include=["fluxes", "aliases"]) self.assertTrue(odata is not None) self.assertFalse(isinstance(odata, list)) self.assertTrue("alias" in odata.keys()) self.assertTrue(len(odata.aliases) > 0) odata = sesame.resolve("NGC4258", include="aliases ") self.assertTrue(odata is not None) self.assertFalse(isinstance(odata, list)) self.assertTrue("alias" in odata.keys()) self.assertTrue(len(odata.aliases) > 0)
def testDb(self): odata = sesame.resolve("NGC4258", "NED") self.assertTrue(odata is not None) self.assertFalse(isinstance(odata, list)) self.assertTrue(odata.resolver_name.startswith("N=NED")) self.assertEquals("MESSIER 106", odata.oname) self.assertTrue("MType" in odata.keys()) odata = sesame.resolve(["NGC4258", "M51"], "NED") self.assertTrue(odata is not None) self.assertTrue(isinstance(odata, list)) self.assertTrue(odata[1].resolver_name.startswith("N=NED")) self.assertEquals("MESSIER 106", odata[0].oname) self.assertEquals("MESSIER 051", odata[1].oname) self.assertTrue("nrefs" in odata[0].keys()) self.assertTrue("nrefs" in odata[1].keys()) odata = sesame.resolve("NGC4258", "Vizier") self.assertTrue(odata is not None) self.assertFalse(isinstance(odata, list)) self.assertTrue(odata.resolver_name.startswith("V=VizieR")) self.assertEquals("{NGC} 4258", odata.oname) self.assertTrue("jpos" in odata.keys())