from indra.databases import go_client


def test_invalid_id():
    go_name = go_client.get_go_label('34jkgfh')
    assert go_name is None


def test_go_id_lookup():
    go_id = 'GO:0001768'
    go_name = go_client.get_go_label(go_id)
    assert go_name == 'establishment of T cell polarity'


def test_go_label_to_id():
    assert go_client.get_go_id_from_label('mitochondrion inheritance') == \
        'GO:0000001'


def test_go_secondary_to_primary():
    assert go_client.get_primary_id('GO:0007067') == 'GO:0000278'


def test_get_valid_location():
    assert go_client.get_valid_location('0001669') == 'acrosomal vesicle'
    assert go_client.get_valid_location('GO:0001669') == 'acrosomal vesicle'
    assert go_client.get_valid_location('acrosomal vesicle') == \
        'acrosomal vesicle'
    assert go_client.get_valid_location('acrosome') == 'acrosomal vesicle'

@@ -847,28 +847,531 @@
 me') == 'acrosomal vesicle'%0A
+%0A%0Adef test_id_from_label_or_synonym():%0A    assert go_client.get_go_id_from_label_or_synonym(%0A        'amoeboidal cell migration') == 'GO:0001667'%0A    assert go_client.get_go_id_from_label_or_synonym(%0A        'ameboidal-type cell migration') == 'GO:0001667'%0A%0A%0Adef test_isa():%0A    assert go_client._client.entries%5B'GO:0001671'%5D%5B'is_a'%5D == %5C%0A        %5B'GO:0008047', 'GO:0060590'%5D%0A%0A%0Adef test_xrefs():%0A    xr = go_client._client.entries%5B'GO:0008463'%5D%5B'xrefs'%5D%5B'KEGG_REACTION'%5D%0A    assert xr == %5B'R00653'%5D, xr%0A

Add more tests for GO client