# Licensed under a 3-clause BSD style license - see LICENSE.rst
from ... import simbad


def test_simbad():
    r = simbad.QueryAroundId('m31', radius='0.5s').execute()
    print r.table
    assert "M  31" in r.table["MAIN_ID"]


def test_multi():
    result = simbad.QueryMulti(
            [simbad.QueryId('m31'),
             simbad.QueryId('m51')])
    table = result.execute().table
    assert "M  31" in table["MAIN_ID"]
    assert "M  51" in table["MAIN_ID"]

if __name__ == "__main__":
    test_simbad()
    test_multi()

@@ -80,16 +80,67 @@
  simbad%0A
+import sys%0Ais_python3 = (sys.version_info %3E= (3,))%0A
 %0A%0Adef te
@@ -231,38 +231,108 @@
 r.table%0A    
-assert %22M  31%22
+if is_python3:%0A        m31 = b%22M  31%22%0A    else:%0A        m31 = %22M  31%22%0A    assert m31
  in r.table%5B
@@ -510,22 +510,137 @@
     
-assert %22M  31%22
+if is_python3:%0A        m31 = b%22M  31%22%0A        m51 = b%22M  51%22%0A    else:%0A        m31 = %22M  31%22%0A        m51 = %22M  51%22%0A    assert m31
  in 
@@ -667,23 +667,19 @@
  assert 
-%22M  
+m
 51
-%22
  in tabl

Fix python3 tests for simbad.