Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Dec 17, 2022
2 parents 8083f4d + 3d5bbe1 commit 9296897
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
5 changes: 2 additions & 3 deletions test/test_chunks_write.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test_put_delete_data
end

def test_reentrant_queries
skip "TODO: why does this test fail?"
ntriples_file_path = "./test/data/nemo_ontology.ntriples"

# Bypass in chunks
Expand All @@ -87,8 +86,8 @@ def test_reentrant_queries

tput = Thread.new {
Goo.sparql_data_client.put_triples(ONT_ID_EXTRA, ntriples_file_path, mime_type="application/x-turtle")
sleep(1.5)
}
sleep(1.5)
count_queries = 0
tq = Thread.new {
5.times do
Expand All @@ -112,8 +111,8 @@ def test_reentrant_queries

tdelete = Thread.new {
Goo.sparql_data_client.delete_graph(ONT_ID_EXTRA)
sleep(1.5)
}
sleep(1.5)
count_queries = 0
tq = Thread.new {
5.times do
Expand Down
18 changes: 9 additions & 9 deletions test/test_collections.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,18 @@ def test_unique_per_collection
def test_inverse_on_collection
skip "Not supported inverse on collection"

john = User.find("John").include(:name).first ||
User.new(name: "John").save()
john = User.find("John").include(:name).first || User.new(name: "John").save

5.times do |i|
Issue.new(description: "issue_#{i}", owner: john).save
Issue.find("issue_#{i}").in(john) || Issue.new(description: "issue_#{i}", owner: john).save
end

binding.pry
User.find("John",include: [:issues]).first.issues
User.find("John",include: [issues: [:desciption]]).first.issues

5.times do |i|
Issue.find("issue_#{i}", collection: john).delete
issues = User.find("John").include(:issues).first.issues
assert_equal 5, issues.size

issues.each do |issue|
assert_equal "issue_#{i}", issue.description
assert_equal john, issue.collection
end
end

Expand Down
10 changes: 8 additions & 2 deletions test/test_read_only.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ def test_struct_find
end

def test_embed_struct
skip "not yet"

students = Student.where(enrolled: [university: [name: "Stanford"]])
.include(:name)
.include(enrolled: [:name, university: [ :address ]])
.include(enrolled: [:name, university: [ :address, :name ]])
.read_only.all

assert_equal 3, students.size
students.each do |st|
assert st.enrolled.any? {|e| e.is_a?(Struct) && e.university.name.eql?('Stanford')}
end

end
end
end

0 comments on commit 9296897

Please sign in to comment.