mirror of
https://github.com/maplibre/martin.git
synced 2024-12-18 12:21:56 +03:00
chore(tests): re-blessed all tests (#1582)
Some checks failed
Documentation / Build Docs (push) Has been cancelled
CI / Lint and Unit test (push) Has been cancelled
CI / Build and test docker images (push) Has been cancelled
CI / Build ${{ matrix.target }} (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Build ${{ matrix.target }} (macos-13, x86_64-apple-darwin) (push) Has been cancelled
CI / Build ${{ matrix.target }} (macos-latest, aarch64-apple-darwin) (push) Has been cancelled
CI / Build ${{ matrix.target }} (ubuntu-latest, debian-x86_64) (push) Has been cancelled
CI / Build ${{ matrix.target }} (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
Demo / Demo (push) Has been cancelled
Code coverage / grcov (push) Has been cancelled
CI / Test AWS Lambda (push) Has been cancelled
CI / Test on ${{ matrix.os }} (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Test on ${{ matrix.os }} (macos-13, x86_64-apple-darwin) (push) Has been cancelled
CI / Test on ${{ matrix.os }} (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key, 15-3.3, require) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres, 11-3.0-alpine, disable) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres, 14-3.3-alpine, disable) (push) Has been cancelled
CI / Package (push) Has been cancelled
CI / CI Finished (push) Has been cancelled
Some checks failed
Documentation / Build Docs (push) Has been cancelled
CI / Lint and Unit test (push) Has been cancelled
CI / Build and test docker images (push) Has been cancelled
CI / Build ${{ matrix.target }} (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Build ${{ matrix.target }} (macos-13, x86_64-apple-darwin) (push) Has been cancelled
CI / Build ${{ matrix.target }} (macos-latest, aarch64-apple-darwin) (push) Has been cancelled
CI / Build ${{ matrix.target }} (ubuntu-latest, debian-x86_64) (push) Has been cancelled
CI / Build ${{ matrix.target }} (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
Demo / Demo (push) Has been cancelled
Code coverage / grcov (push) Has been cancelled
CI / Test AWS Lambda (push) Has been cancelled
CI / Test on ${{ matrix.os }} (.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / Test on ${{ matrix.os }} (macos-13, x86_64-apple-darwin) (push) Has been cancelled
CI / Test on ${{ matrix.os }} (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key, 15-3.3, require) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres, 11-3.0-alpine, disable) (push) Has been cancelled
CI / Test postgis:${{ matrix.img_ver }} sslmode=${{ matrix.sslmode }} (postgres, 14-3.3-alpine, disable) (push) Has been cancelled
CI / Package (push) Has been cancelled
CI / CI Finished (push) Has been cancelled
insta currently produces this (quite annoying) warning: ![image](https://github.com/user-attachments/assets/253af8dd-c3f0-47e9-9812-8df377c8af47) => this PR re-blesses all files to get rid of it
This commit is contained in:
parent
6b3da490d1
commit
12e51675cd
@ -458,46 +458,31 @@ mod tests {
|
|||||||
let bbox_mi = Bounds::from_str("-86.6271,41.6811,-82.3095,45.8058").unwrap();
|
let bbox_mi = Bounds::from_str("-86.6271,41.6811,-82.3095,45.8058").unwrap();
|
||||||
let bbox_usa = Bounds::from_str("-124.8489,24.3963,-66.8854,49.3843").unwrap();
|
let bbox_usa = Bounds::from_str("-124.8489,24.3963,-66.8854,49.3843").unwrap();
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[0])), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[0])), @r#"- "0: (0,0) - (0,0)""#);
|
||||||
---
|
|
||||||
- "0: (0,0) - (0,0)"
|
|
||||||
"###);
|
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[3,7])), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[3,7])), @r#"
|
||||||
---
|
|
||||||
- "3: (0,0) - (7,7)"
|
- "3: (0,0) - (7,7)"
|
||||||
- "7: (0,0) - (127,127)"
|
- "7: (0,0) - (127,127)"
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&arg_minmax(&[world], 2, 4)), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&arg_minmax(&[world], 2, 4)), @r#"
|
||||||
---
|
|
||||||
- "2: (0,0) - (3,3)"
|
- "2: (0,0) - (3,3)"
|
||||||
- "3: (0,0) - (7,7)"
|
- "3: (0,0) - (7,7)"
|
||||||
- "4: (0,0) - (15,15)"
|
- "4: (0,0) - (15,15)"
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[14])), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&args(&[world], &[14])), @r#"- "14: (0,0) - (16383,16383)""#);
|
||||||
---
|
|
||||||
- "14: (0,0) - (16383,16383)"
|
|
||||||
"###);
|
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa], &[14])), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa], &[14])), @r#"- "14: (2509,5599) - (5147,7046)""#);
|
||||||
---
|
|
||||||
- "14: (2509,5599) - (5147,7046)"
|
|
||||||
"###);
|
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa, bbox_mi, bbox_ca], &[14])), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_usa, bbox_mi, bbox_ca], &[14])), @r#"- "14: (2509,5599) - (5147,7046)""#);
|
||||||
---
|
|
||||||
- "14: (2509,5599) - (5147,7046)"
|
|
||||||
"###);
|
|
||||||
|
|
||||||
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_ca_south, bbox_mi, bbox_ca], &[14])), @r###"
|
assert_yaml_snapshot!(compute_tile_ranges(&args(&[bbox_ca_south, bbox_mi, bbox_ca], &[14])), @r#"
|
||||||
---
|
|
||||||
- "14: (2791,6499) - (2997,6624)"
|
- "14: (2791,6499) - (2997,6624)"
|
||||||
- "14: (4249,5841) - (4446,6101)"
|
- "14: (4249,5841) - (4446,6101)"
|
||||||
- "14: (2526,6081) - (2790,6624)"
|
- "14: (2526,6081) - (2790,6624)"
|
||||||
- "14: (2791,6081) - (2997,6498)"
|
- "14: (2791,6081) - (2997,6498)"
|
||||||
"###);
|
"#);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn args(bbox: &[Bounds], zooms: &[u8]) -> CopyArgs {
|
fn args(bbox: &[Bounds], zooms: &[u8]) -> CopyArgs {
|
||||||
|
@ -496,95 +496,86 @@ mod tests {
|
|||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
fn test_auto_publish_no_auto() {
|
fn test_auto_publish_no_auto() {
|
||||||
let cfg = auto("{}");
|
let cfg = auto("{}");
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
source_id_format: "{table}"
|
source_id_format: "{table}"
|
||||||
auto_funcs:
|
auto_funcs:
|
||||||
source_id_format: "{function}"
|
source_id_format: "{function}"
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto("tables: {}");
|
let cfg = auto("tables: {}");
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r"
|
||||||
---
|
|
||||||
auto_table: ~
|
auto_table: ~
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
");
|
||||||
|
|
||||||
let cfg = auto("functions: {}");
|
let cfg = auto("functions: {}");
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r"
|
||||||
---
|
|
||||||
auto_table: ~
|
auto_table: ~
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
");
|
||||||
|
|
||||||
let cfg = auto("auto_publish: true");
|
let cfg = auto("auto_publish: true");
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
source_id_format: "{table}"
|
source_id_format: "{table}"
|
||||||
auto_funcs:
|
auto_funcs:
|
||||||
source_id_format: "{function}"
|
source_id_format: "{function}"
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto("auto_publish: false");
|
let cfg = auto("auto_publish: false");
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r"
|
||||||
---
|
|
||||||
auto_table: ~
|
auto_table: ~
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
");
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
from_schemas: public
|
from_schemas: public
|
||||||
tables: true"});
|
tables: true"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
schemas:
|
schemas:
|
||||||
- public
|
- public
|
||||||
source_id_format: "{table}"
|
source_id_format: "{table}"
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
from_schemas: public
|
from_schemas: public
|
||||||
functions: true"});
|
functions: true"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table: ~
|
auto_table: ~
|
||||||
auto_funcs:
|
auto_funcs:
|
||||||
schemas:
|
schemas:
|
||||||
- public
|
- public
|
||||||
source_id_format: "{function}"
|
source_id_format: "{function}"
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
from_schemas: public
|
from_schemas: public
|
||||||
tables: false"});
|
tables: false"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table: ~
|
auto_table: ~
|
||||||
auto_funcs:
|
auto_funcs:
|
||||||
schemas:
|
schemas:
|
||||||
- public
|
- public
|
||||||
source_id_format: "{function}"
|
source_id_format: "{function}"
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
from_schemas: public
|
from_schemas: public
|
||||||
functions: false"});
|
functions: false"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
schemas:
|
schemas:
|
||||||
- public
|
- public
|
||||||
source_id_format: "{table}"
|
source_id_format: "{table}"
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
@ -592,15 +583,14 @@ mod tests {
|
|||||||
tables:
|
tables:
|
||||||
from_schemas: osm
|
from_schemas: osm
|
||||||
id_format: 'foo_{schema}.{table}_bar'"});
|
id_format: 'foo_{schema}.{table}_bar'"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
schemas:
|
schemas:
|
||||||
- osm
|
- osm
|
||||||
- public
|
- public
|
||||||
source_id_format: "foo_{schema}.{table}_bar"
|
source_id_format: "foo_{schema}.{table}_bar"
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
@ -608,15 +598,14 @@ mod tests {
|
|||||||
tables:
|
tables:
|
||||||
from_schemas: osm
|
from_schemas: osm
|
||||||
source_id_format: '{schema}.{table}'"});
|
source_id_format: '{schema}.{table}'"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
schemas:
|
schemas:
|
||||||
- osm
|
- osm
|
||||||
- public
|
- public
|
||||||
source_id_format: "{schema}.{table}"
|
source_id_format: "{schema}.{table}"
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
"#);
|
||||||
|
|
||||||
let cfg = auto(indoc! {"
|
let cfg = auto(indoc! {"
|
||||||
auto_publish:
|
auto_publish:
|
||||||
@ -624,14 +613,13 @@ mod tests {
|
|||||||
from_schemas:
|
from_schemas:
|
||||||
- osm
|
- osm
|
||||||
- public"});
|
- public"});
|
||||||
assert_yaml_snapshot!(cfg, @r###"
|
assert_yaml_snapshot!(cfg, @r#"
|
||||||
---
|
|
||||||
auto_table:
|
auto_table:
|
||||||
schemas:
|
schemas:
|
||||||
- osm
|
- osm
|
||||||
- public
|
- public
|
||||||
source_id_format: "{table}"
|
source_id_format: "{table}"
|
||||||
auto_funcs: ~
|
auto_funcs: ~
|
||||||
"###);
|
"#);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,8 +53,7 @@ async fn mbt_get_catalog() {
|
|||||||
let response = call_service(&app, req).await;
|
let response = call_service(&app, req).await;
|
||||||
let response = assert_response(response).await;
|
let response = assert_response(response).await;
|
||||||
let body: serde_json::Value = read_body_json(response).await;
|
let body: serde_json::Value = read_body_json(response).await;
|
||||||
assert_yaml_snapshot!(body, @r###"
|
assert_yaml_snapshot!(body, @r"
|
||||||
---
|
|
||||||
fonts: {}
|
fonts: {}
|
||||||
sprites: {}
|
sprites: {}
|
||||||
tiles:
|
tiles:
|
||||||
@ -73,7 +72,7 @@ async fn mbt_get_catalog() {
|
|||||||
m_webp:
|
m_webp:
|
||||||
content_type: image/webp
|
content_type: image/webp
|
||||||
name: ne2sr
|
name: ne2sr
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
@ -85,8 +84,7 @@ async fn mbt_get_catalog_gzip() {
|
|||||||
let response = assert_response(response).await;
|
let response = assert_response(response).await;
|
||||||
let body = decode_gzip(&read_body(response).await).unwrap();
|
let body = decode_gzip(&read_body(response).await).unwrap();
|
||||||
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
||||||
assert_yaml_snapshot!(body, @r###"
|
assert_yaml_snapshot!(body, @r"
|
||||||
---
|
|
||||||
fonts: {}
|
fonts: {}
|
||||||
sprites: {}
|
sprites: {}
|
||||||
tiles:
|
tiles:
|
||||||
@ -105,7 +103,7 @@ async fn mbt_get_catalog_gzip() {
|
|||||||
m_webp:
|
m_webp:
|
||||||
content_type: image/webp
|
content_type: image/webp
|
||||||
name: ne2sr
|
name: ne2sr
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
@ -17,14 +17,13 @@ fn init() {
|
|||||||
async fn function_source_tilejson() {
|
async fn function_source_tilejson() {
|
||||||
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
|
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
|
||||||
let tj = source(&mock, "function_zxy_query").get_tilejson();
|
let tj = source(&mock, "function_zxy_query").get_tilejson();
|
||||||
assert_yaml_snapshot!(tj, @r###"
|
assert_yaml_snapshot!(tj, @r"
|
||||||
---
|
|
||||||
tilejson: 3.0.0
|
tilejson: 3.0.0
|
||||||
tiles: []
|
tiles: []
|
||||||
name: function_zxy_query
|
name: function_zxy_query
|
||||||
foo:
|
foo:
|
||||||
bar: foo
|
bar: foo
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
@ -55,10 +54,9 @@ async fn function_source_schemas() {
|
|||||||
from_schemas: MixedCase
|
from_schemas: MixedCase
|
||||||
"});
|
"});
|
||||||
let sources = mock_sources(cfg).await.0.tiles;
|
let sources = mock_sources(cfg).await.0.tiles;
|
||||||
assert_yaml_snapshot!(sources.get_catalog(), @r###"
|
assert_yaml_snapshot!(sources.get_catalog(), @r"
|
||||||
---
|
|
||||||
function_Mixed_Name:
|
function_Mixed_Name:
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: a function source with MixedCase name
|
description: a function source with MixedCase name
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,6 @@ postgres:
|
|||||||
let body = read_body(response).await;
|
let body = read_body(response).await;
|
||||||
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
||||||
assert_yaml_snapshot!(body, @r#"
|
assert_yaml_snapshot!(body, @r#"
|
||||||
---
|
|
||||||
fonts: {}
|
fonts: {}
|
||||||
sprites: {}
|
sprites: {}
|
||||||
tiles:
|
tiles:
|
||||||
@ -188,8 +187,7 @@ postgres:
|
|||||||
.insert_header(("x-rewrite-url", "/tiles/table_source?token=martin"))
|
.insert_header(("x-rewrite-url", "/tiles/table_source?token=martin"))
|
||||||
.to_request();
|
.to_request();
|
||||||
let result: TileJSON = call_and_read_body_json(&app, req).await;
|
let result: TileJSON = call_and_read_body_json(&app, req).await;
|
||||||
assert_yaml_snapshot!(result, @r###"
|
assert_yaml_snapshot!(result, @r#"
|
||||||
---
|
|
||||||
tilejson: 3.0.0
|
tilejson: 3.0.0
|
||||||
tiles:
|
tiles:
|
||||||
- "http://localhost:8080/tiles/table_source/{z}/{x}/{y}?token=martin"
|
- "http://localhost:8080/tiles/table_source/{z}/{x}/{y}?token=martin"
|
||||||
@ -205,7 +203,7 @@ postgres:
|
|||||||
name: table_source
|
name: table_source
|
||||||
foo:
|
foo:
|
||||||
bar: foo
|
bar: foo
|
||||||
"###);
|
"#);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
@ -1025,8 +1023,7 @@ tables:
|
|||||||
assert_eq!(src.id_column, None);
|
assert_eq!(src.id_column, None);
|
||||||
assert!(matches!(&src.properties, Some(v) if v.len() == 1));
|
assert!(matches!(&src.properties, Some(v) if v.len() == 1));
|
||||||
let tj = source(&mock, "no_id").get_tilejson();
|
let tj = source(&mock, "no_id").get_tilejson();
|
||||||
assert_yaml_snapshot!(tj, @r###"
|
assert_yaml_snapshot!(tj, @r"
|
||||||
---
|
|
||||||
tilejson: 3.0.0
|
tilejson: 3.0.0
|
||||||
tiles: []
|
tiles: []
|
||||||
vector_layers:
|
vector_layers:
|
||||||
@ -1041,10 +1038,9 @@ tables:
|
|||||||
- 90
|
- 90
|
||||||
description: a description from comment on table
|
description: a description from comment on table
|
||||||
name: no_id
|
name: no_id
|
||||||
"###);
|
");
|
||||||
|
|
||||||
assert_yaml_snapshot!(table(&mock, "id_only"), @r###"
|
assert_yaml_snapshot!(table(&mock, "id_only"), @r"
|
||||||
---
|
|
||||||
schema: MixedCase
|
schema: MixedCase
|
||||||
table: MixPoints
|
table: MixPoints
|
||||||
srid: 4326
|
srid: 4326
|
||||||
@ -1058,10 +1054,9 @@ tables:
|
|||||||
geometry_type: POINT
|
geometry_type: POINT
|
||||||
properties:
|
properties:
|
||||||
TABLE: text
|
TABLE: text
|
||||||
"###);
|
");
|
||||||
|
|
||||||
assert_yaml_snapshot!(table(&mock, "id_and_prop"), @r###"
|
assert_yaml_snapshot!(table(&mock, "id_and_prop"), @r"
|
||||||
---
|
|
||||||
schema: MixedCase
|
schema: MixedCase
|
||||||
table: MixPoints
|
table: MixPoints
|
||||||
srid: 4326
|
srid: 4326
|
||||||
@ -1076,10 +1071,9 @@ tables:
|
|||||||
properties:
|
properties:
|
||||||
TABLE: text
|
TABLE: text
|
||||||
giD: int4
|
giD: int4
|
||||||
"###);
|
");
|
||||||
|
|
||||||
assert_yaml_snapshot!(table(&mock, "prop_only"), @r###"
|
assert_yaml_snapshot!(table(&mock, "prop_only"), @r"
|
||||||
---
|
|
||||||
schema: MixedCase
|
schema: MixedCase
|
||||||
table: MixPoints
|
table: MixPoints
|
||||||
srid: 4326
|
srid: 4326
|
||||||
@ -1093,7 +1087,7 @@ tables:
|
|||||||
properties:
|
properties:
|
||||||
TABLE: text
|
TABLE: text
|
||||||
giD: int4
|
giD: int4
|
||||||
"###);
|
");
|
||||||
|
|
||||||
// --------------------------------------------
|
// --------------------------------------------
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ fn init() {
|
|||||||
async fn table_source() {
|
async fn table_source() {
|
||||||
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
|
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
|
||||||
assert_yaml_snapshot!(mock.0.tiles.get_catalog(), @r#"
|
assert_yaml_snapshot!(mock.0.tiles.get_catalog(), @r#"
|
||||||
---
|
|
||||||
"-function.withweired---_-characters":
|
"-function.withweired---_-characters":
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: a function source with special characters
|
description: a function source with special characters
|
||||||
@ -91,8 +90,7 @@ async fn table_source() {
|
|||||||
"#);
|
"#);
|
||||||
|
|
||||||
let source = table(&mock, "table_source");
|
let source = table(&mock, "table_source");
|
||||||
assert_yaml_snapshot!(source, @r###"
|
assert_yaml_snapshot!(source, @r"
|
||||||
---
|
|
||||||
schema: public
|
schema: public
|
||||||
table: table_source
|
table: table_source
|
||||||
srid: 4326
|
srid: 4326
|
||||||
@ -105,15 +103,14 @@ async fn table_source() {
|
|||||||
geometry_type: GEOMETRY
|
geometry_type: GEOMETRY
|
||||||
properties:
|
properties:
|
||||||
gid: int4
|
gid: int4
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
async fn tables_tilejson() {
|
async fn tables_tilejson() {
|
||||||
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
|
let mock = mock_sources(mock_pgcfg("connection_string: $DATABASE_URL")).await;
|
||||||
let tj = source(&mock, "table_source").get_tilejson();
|
let tj = source(&mock, "table_source").get_tilejson();
|
||||||
assert_yaml_snapshot!(tj, @r###"
|
assert_yaml_snapshot!(tj, @r"
|
||||||
---
|
|
||||||
tilejson: 3.0.0
|
tilejson: 3.0.0
|
||||||
tiles: []
|
tiles: []
|
||||||
vector_layers:
|
vector_layers:
|
||||||
@ -128,7 +125,7 @@ async fn tables_tilejson() {
|
|||||||
name: table_source
|
name: table_source
|
||||||
foo:
|
foo:
|
||||||
bar: foo
|
bar: foo
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
@ -184,10 +181,9 @@ async fn table_source_schemas() {
|
|||||||
functions: false
|
functions: false
|
||||||
"});
|
"});
|
||||||
let sources = mock_sources(cfg).await.0;
|
let sources = mock_sources(cfg).await.0;
|
||||||
assert_yaml_snapshot!(sources.tiles.get_catalog(), @r###"
|
assert_yaml_snapshot!(sources.tiles.get_catalog(), @r"
|
||||||
---
|
|
||||||
MixPoints:
|
MixPoints:
|
||||||
content_type: application/x-protobuf
|
content_type: application/x-protobuf
|
||||||
description: a description from comment on table
|
description: a description from comment on table
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
@ -51,14 +51,13 @@ async fn pmt_get_catalog() {
|
|||||||
let response = call_service(&app, req).await;
|
let response = call_service(&app, req).await;
|
||||||
let response = assert_response(response).await;
|
let response = assert_response(response).await;
|
||||||
let body: serde_json::Value = read_body_json(response).await;
|
let body: serde_json::Value = read_body_json(response).await;
|
||||||
assert_yaml_snapshot!(body, @r###"
|
assert_yaml_snapshot!(body, @r"
|
||||||
---
|
|
||||||
fonts: {}
|
fonts: {}
|
||||||
sprites: {}
|
sprites: {}
|
||||||
tiles:
|
tiles:
|
||||||
stamen_toner__raster_CC-BY-ODbL_z3:
|
stamen_toner__raster_CC-BY-ODbL_z3:
|
||||||
content_type: image/png
|
content_type: image/png
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
@ -70,14 +69,13 @@ async fn pmt_get_catalog_gzip() {
|
|||||||
let response = assert_response(response).await;
|
let response = assert_response(response).await;
|
||||||
let body = decode_gzip(&read_body(response).await).unwrap();
|
let body = decode_gzip(&read_body(response).await).unwrap();
|
||||||
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
let body: serde_json::Value = serde_json::from_slice(&body).unwrap();
|
||||||
assert_yaml_snapshot!(body, @r###"
|
assert_yaml_snapshot!(body, @r"
|
||||||
---
|
|
||||||
fonts: {}
|
fonts: {}
|
||||||
sprites: {}
|
sprites: {}
|
||||||
tiles:
|
tiles:
|
||||||
p_png:
|
p_png:
|
||||||
content_type: image/png
|
content_type: image/png
|
||||||
"###);
|
");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[actix_rt::test]
|
#[actix_rt::test]
|
||||||
|
@ -202,8 +202,7 @@ mod tests {
|
|||||||
|
|
||||||
init_mbtiles_schema(&mut conn, MbtType::Flat).await.unwrap();
|
init_mbtiles_schema(&mut conn, MbtType::Flat).await.unwrap();
|
||||||
let res = mbt.summary(&mut conn).await?;
|
let res = mbt.summary(&mut conn).await?;
|
||||||
assert_yaml_snapshot!(res, @r###"
|
assert_yaml_snapshot!(res, @r"
|
||||||
---
|
|
||||||
file_size: ~
|
file_size: ~
|
||||||
mbt_type: Flat
|
mbt_type: Flat
|
||||||
page_size: 512
|
page_size: 512
|
||||||
@ -216,7 +215,7 @@ mod tests {
|
|||||||
min_zoom: ~
|
min_zoom: ~
|
||||||
max_zoom: ~
|
max_zoom: ~
|
||||||
zoom_info: []
|
zoom_info: []
|
||||||
"###);
|
");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -228,8 +227,7 @@ mod tests {
|
|||||||
|
|
||||||
let res = mbt.summary(&mut conn).await?;
|
let res = mbt.summary(&mut conn).await?;
|
||||||
|
|
||||||
assert_yaml_snapshot!(res, @r###"
|
assert_yaml_snapshot!(res, @r"
|
||||||
---
|
|
||||||
file_size: 49152
|
file_size: 49152
|
||||||
mbt_type: Flat
|
mbt_type: Flat
|
||||||
page_size: 4096
|
page_size: 4096
|
||||||
@ -316,7 +314,7 @@ mod tests {
|
|||||||
- -40.97989806962015
|
- -40.97989806962015
|
||||||
- 180.00000000000003
|
- 180.00000000000003
|
||||||
- 61.60639637138628
|
- 61.60639637138628
|
||||||
"###);
|
");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user