Skip to content

Commit

Permalink
removed testing core functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
kaat0 committed Jul 2, 2024
1 parent eb6c37e commit 3678412
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ Categories: Added, Changed, Deprecated, Removed, Fixed, and Security.

## [Unreleased]

### Added
* Loglevel as Setting

### Changed
* load of Schema via Lazy Artifact instead of hard coded
* faster poi handling by treating pois as a DataFrame

## Version [1.0.4] 2023-05-15

Expand Down
1 change: 1 addition & 0 deletions src/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ function get_schema(data::Dict)::Schema
fragment = URIs.splitpath(schema)
schema_subtype = pop!(fragment)
@debug "loading file - detected schema subtype: $schema_subtype"
# discard the rest of the fragment

schema_name = join([schema.host, schema_version], "-")
schema_name = replace(schema_name, r"\." => "-")
Expand Down
13 changes: 4 additions & 9 deletions test/artifact_schema_loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ using LazyArtifacts, YAML, JSONSchema
"schema_version" => "2022.05",
"schema" => "https://railtoolkit.org/schema/rolling-stock.json"
)

artifactpath_railtoolkit_schema_2022 = artifact"railtoolkit-org-2022-05"
artifactpath_sha1 = split(artifactpath_railtoolkit_schema_2022, "/")[end]
@test artifactpath_sha1 == "0dc2382451d64a12b8e8aa95c83a81dc5ac1c108"
unrecognized_schema = Dict(
"schema_version" => "1",
"schema" => "http://unrecognized-schema/subtype"
)

railtoolkit_schema_2022_running_path = TrainRuns.get_schema(railtoolkit_schema_2022_running_path)
path_schema_2022 = YAML.load(open("data/paths/path_schema_2022.yaml"))
Expand All @@ -28,11 +28,6 @@ using LazyArtifacts, YAML, JSONSchema
railtoolkit_schema_2022_rolling_stock = TrainRuns.get_schema(railtoolkit_schema_2022_rolling_stock)
train_schema_2022 = YAML.load(open("data/trains/train_schema_2022.yaml"))
@test JSONSchema.isvalid(railtoolkit_schema_2022_rolling_stock, train_schema_2022)

unrecognized_schema = Dict(
"schema_version" => "1",
"schema" => "http://unrecognized-schema/subtype"
)
logger = ConsoleLogger(stderr, Warn)
with_logger(logger) do
@test_throws ErrorException("The provided schema 'http://unrecognized-schema/subtype' version '1' is not recognized!") TrainRuns.get_schema(unrecognized_schema)
Expand Down

0 comments on commit 3678412

Please sign in to comment.