e828acf175
CI / lint (push) Successful in 1m32s
CI / typecheck (push) Successful in 1m38s
CI / lint (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 1m30s
CI / behave (3.11) (pull_request) Successful in 1m39s
CI / behave (3.12) (pull_request) Successful in 1m39s
CI / build (pull_request) Successful in 1m29s
CI / behave (3.13) (pull_request) Successful in 1m39s
CI / behave (3.11) (push) Successful in 1m39s
CI / behave (3.12) (push) Successful in 1m41s
CI / behave (3.13) (push) Successful in 1m37s
CI / build (push) Successful in 1m30s
ISSUES CLOSED: #1
Robot Framework Tests for CleverRDFLib
This directory contains Robot Framework integration tests for the CleverRDFLib library.
Structure
test_data/- Test ontology files (RDF/OWL files) used by the testslibraries/- Custom Python keyword libraries for Robot Framework*.robot- Robot Framework test suite files
Test Suites
ontology_loader_tests.robot
Tests for the core OntologyLoader functionality:
- Loading ontologies from files
- Different loading strategies (depth-first, breadth-first)
- Max depth constraints
- Validation options
loading_result_tests.robot
Tests for the LoadingResult class:
- Merged graph access
- Loaded URI tracking
- Success/failure indication
- Error and warning tracking
class_hierarchy_tests.robot
Tests for the ClassHierarchy functionality:
- Class hierarchy building
- Parent/child relationships
- Class navigation
owl_features_tests.robot
Tests for OWL-specific features:
- Metadata extraction
- OWL validation
- Consistency checking
- Version management
graph_operations_tests.robot
Tests for graph operations:
- Triple queries
- Graph structure verification
- RDF/RDFS/OWL assertions
error_handling_tests.robot
Tests for error handling and exception scenarios:
- Non-existent file handling
- Invalid syntax handling
- Error propagation
- Exception types
Running Tests
Run all tests
nox -s integration_tests
Run specific test suite
nox -s integration_tests -- robot/ontology_loader_tests.robot
Run tests with specific tags
nox -s integration_tests -- --include basic robot/
Run slow tests
nox -s slow_integration_tests
Custom Keywords
The CleverRDFLibKeywords library provides custom keywords for testing:
Create Ontology Loader- Create an OntologyLoader instanceLoad Ontology- Load an ontology from URI or file pathLoad Ontology Should Succeed- Load and verify successLoad Ontology Should Fail- Load and verify failureResult Should Have Loaded Count- Verify loaded countResult Should Have No Errors- Verify no errorsGet Merged Graph- Get the merged RDF graphGet Class Hierarchy- Get the class hierarchyClass Hierarchy Should Contain Class- Verify class existsClass Should Have Parent- Verify parent relationshipClass Should Have Child- Verify child relationshipGet OWL Metadata- Get OWL metadataGet OWL Validation Result- Get validation resultGet OWL Consistency Result- Get consistency result- And more...
Test Data
Test data files are located in test_data/:
simple_ontology.ttl- Simple ontology with basic classes and propertiescomplex_ontology.ttl- Complex ontology with class hierarchyinvalid_ontology.ttl- Ontology with intentional issues for error testing
Notes
- Robot Framework does not support the
-coption - Remember to
import oswhen working with OS-related functionality in Python libraries - Test results are written to
build/reports/robot/