Skip to content

Commit

Permalink
tests for new descendants
Browse files Browse the repository at this point in the history
  • Loading branch information
maximsch2 committed Mar 31, 2017
1 parent 46a1116 commit 7c33e1e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 7 additions & 0 deletions test/data/go_mini.obo
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ name: five
namespace: biological_process
def: DDD
is_a: GO:0000004

[Term]
id: GO:0000006
name: six
namespace: biological_process
def: EEE
relationship: part_of GO:0000005
3 changes: 3 additions & 0 deletions test/test_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ end
term2 = gettermbyid(GO, 2)
term4 = gettermbyid(GO, 4)
term5 = gettermbyid(GO, 5)
term6 = gettermbyid(GO, 6)

test_isa(GO, term1, term2)
test_isa(GO, term4, term2)
Expand All @@ -34,4 +35,6 @@ end

@test Set(descendants(GO, term2)) == Set([term1, term4, term5])
@test descendants(GO, term5) == []

@test Set(descendants(GO, term2, [:is_a, :part_of])) == Set([term1, term4, term5, term6])
end
7 changes: 4 additions & 3 deletions test/test_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ end

@testset "parseOBO() tests" begin
header, stanzas = parseOBO("$testdir/data/go_mini.obo")
@test length(stanzas) == 4
@test length(stanzas) == 5
@test header["format-version"] == ["1.2"]

terms = getterms(stanzas)
@test length(terms) == 4
@test length(terms) == 5
end

@testset "load() tests" begin
GO = OBOParse.load("$testdir/data/go_mini.obo", "GO")

@test length(GO) == 4
@test length(GO) == 5
@test GO["GO:0000002"].name == "two"
@test GO["GO:0000001"].name == "one"
@test GO["GO:0000004"].name == "four"
@test GO["GO:0000005"].name == "five"
@test GO["GO:0000006"].name == "six"
end

@testset "test parse GO" begin
Expand Down

0 comments on commit 7c33e1e

Please sign in to comment.