Skip to content

Commit

Permalink
disable complex validators tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Oct 12, 2023
1 parent a60b483 commit dcf9c06
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: 1d78bde5a711d05475da0459308c7db074af5e21
revision: 69466682c1e9cb2c338539195013dbec9714ca7d
branch: development
specs:
goo (0.0.2)
Expand Down Expand Up @@ -78,7 +78,7 @@ GEM
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ffi (1.15.5)
ffi (1.16.3)
hashdiff (1.0.1)
hashie (5.0.0)
htmlentities (4.3.4)
Expand All @@ -105,7 +105,7 @@ GEM
method_source (1.0.0)
mime-types (3.5.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0808)
mime-types-data (3.2023.1003)
mini_mime (1.1.5)
minitest (4.7.5)
minitest-reporters (0.14.24)
Expand All @@ -116,21 +116,21 @@ GEM
multi_json (1.15.0)
multipart-post (2.3.0)
net-http-persistent (2.9.4)
net-imap (0.3.7)
net-imap (0.4.1)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-smtp (0.4.0)
net-protocol
netrc (0.11.0)
oj (2.18.5)
omni_logger (0.1.4)
logger
parallel (1.23.0)
parser (3.2.2.3)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pony (1.13.1)
Expand All @@ -151,9 +151,9 @@ GEM
addressable (>= 2.2)
redis (5.0.7)
redis-client (>= 0.9.0)
redis-client (0.16.0)
redis-client (0.17.0)
connection_pool
regexp_parser (2.8.1)
regexp_parser (2.8.2)
request_store (1.5.1)
rack (>= 1.4)
rest-client (2.1.0)
Expand All @@ -164,12 +164,12 @@ GEM
rexml (3.2.6)
rsolr (1.1.2)
builder (>= 2.1.2)
rubocop (1.56.1)
rubocop (1.57.0)
base64 (~> 0.1.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.3)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
Expand Down Expand Up @@ -203,10 +203,10 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.4.2)
unicode-display_width (2.5.0)
uuid (2.3.9)
macaddr (~> 1.0)
webmock (3.18.1)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down
18 changes: 12 additions & 6 deletions test/models/test_ontology_submission_validators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
class TestOntologySubmissionValidators < LinkedData::TestOntologyCommon

def test_enforce_symmetric_ontologies
skip 'complex validators disabled'
ontologies_properties_callbacks(:ontologyRelatedTo)
end

Expand All @@ -16,7 +17,7 @@ def test_lexvo_language_validator
sub.bring_remaining
assert sub.valid?

sub.naturalLanguage = ["fr" , "http://iso639-3/eng"]
sub.naturalLanguage = ["fr", "http://iso639-3/eng"]

refute sub.valid?
assert sub.errors[:naturalLanguage][:lexvo_language]
Expand All @@ -29,6 +30,7 @@ def test_lexvo_language_validator

# Regroup all validity test related to a submission retired status (deprecated, valid date)
def test_submission_retired_validity
skip 'complex validators disabled'
sorted_submissions = sorted_submissions_init

latest = sorted_submissions.first
Expand Down Expand Up @@ -72,6 +74,7 @@ def test_submission_retired_validity
end

def test_modification_date_previous_align
skip 'complex validators disabled'
sorted_submissions = sorted_submissions_init

latest = sorted_submissions[0]
Expand Down Expand Up @@ -104,16 +107,20 @@ def test_modification_date_previous_align
end

def test_has_prior_version_callback
skip 'complex validators disabled'

sorted_submissions = sorted_submissions_init

sorted_submissions.each_cons(2) do |current, previous|
current.bring :hasPriorVersion
refute_nil current.hasPriorVersion
assert previous.id, current.hasPriorVersion
end

end

def test_update_submissions_has_part
skip 'complex validators disabled'
ont_count, ont_acronyms, ontologies =
create_ontologies_and_submissions(ont_count: 3, submission_count: 1,
process_submission: false, acronym: 'NCBO-545')
Expand Down Expand Up @@ -165,6 +172,7 @@ def test_update_submissions_has_part
end

def test_inverse_use_imports_callback
skip 'complex validators disabled'
ontologies_properties_callbacks(:useImports, :usedBy)
end

Expand All @@ -184,14 +192,12 @@ def sorted_submissions_init(submission_count = 3)
ont.submissions.sort { |a, b| b.submissionId <=> a.submissionId }
end


def ontologies_properties_callbacks(attr, inverse_attr = nil)
inverse_attr = attr unless inverse_attr
inverse_attr = attr unless inverse_attr
ont_count, ont_acronyms, ontologies =
create_ontologies_and_submissions(ont_count: 3, submission_count: 1,
process_submission: false, acronym: 'NCBO-545')


assert_equal 3, ontologies.size

ontologies[0].bring :submissions
Expand All @@ -202,7 +208,7 @@ def ontologies_properties_callbacks(attr, inverse_attr = nil)

assert_empty first_sub.send(attr)
first_sub.bring_remaining
first_sub.send( "#{attr}=",[ontologies[1].id, ontologies[2].id])
first_sub.send("#{attr}=", [ontologies[1].id, ontologies[2].id])

assert first_sub.valid?

Expand All @@ -216,7 +222,7 @@ def ontologies_properties_callbacks(attr, inverse_attr = nil)
assert_equal [ontologies[0].id], sub.send(inverse_attr)
end

#sub is the submission of the ontology 2
# sub is the submission of the ontology 2
sub.bring_remaining
sub.send("#{inverse_attr}=", [])
sub.save
Expand Down

0 comments on commit dcf9c06

Please sign in to comment.