Browse Source

Remove unused fixtures and workflow files.

Now that we use bragi and VRC for mocking, we don't need to seed a
database any longer. So we don't need the workflows and most fixtures.

The sink is still running, though, and while this does not do anything,
removing it, is not for now. Sink needs some fixtures still
tags/0.3.6^2
Bèr Kessels 2 months ago
parent
commit
0e81dd16e4

+ 0
- 22
test/fixtures/input/aldi_arnhem.json View File

@@ -1,22 +0,0 @@
{
"type": "Feature",
"id": "34045145",
"geometry": {
"type": "Point",
"coordinates": [
5.8941842,
51.9413713
]
},
"properties": {
"brand": "Aldi",
"brand:wikidata": "Q125054",
"brand:wikipedia": "en:Aldi",
"description": "Arnhem, Het toneel",
"name": "Aldi",
"note": "ODBL clean: geen disclaimer/copyright aangetroffen op winkelgegevens Aldi (stand: juni 2012)",
"opening_hours": "Mo-Sa 08:00-20:00; Su 12:00-18:00",
"shop": "supermarket",
"wheelchair": "limited"
}
}

+ 0
- 37
test/fixtures/input/arnhem_city.json View File

@@ -1,37 +0,0 @@
{
"type": "Feature",
"id": "6394641551",
"geometry": {
"type": "Point",
"coordinates": [
5.9108573,
51.984257
]
},
"properties": {
"capital": "4",
"name": "Arnhem",
"name:ar": "أرنهيم",
"name:de": "Arnheim",
"name:en": "Arnhem",
"name:es": "Arnhem",
"name:fr": "Arnhem",
"name:fy": "Arnhim",
"name:he": "ארנהם",
"name:la": "Arenacum",
"name:lt": "Arnhemas",
"name:nds": "Arnem",
"name:nl": "Arnhem",
"name:ru": "Арнем",
"name:sr": "Арнем",
"name:uk": "Арнем",
"place": "city",
"population": "155694",
"population:date": "2017-01-01",
"population:note": "Inwonertal inclusief Elden en Schaarsbergen",
"source:population": "https://arnhem.buurtmonitor.nl//jive",
"website": "https://www.arnhem.nl/",
"wikidata": "Q1310",
"wikipedia": "nl:Arnhem"
}
}

+ 0
- 41
test/fixtures/input/denbosch_city.json View File

@@ -1,41 +0,0 @@
{
"type": "Feature",
"id": "60400458",
"geometry": {
"type": "Point",
"coordinates": [
5.3031044,
51.6889351
]
},
"properties": {
"alt_name": "Den Bosch",
"capital": "4",
"loc_name": "Den Bosch",
"name": "'s-Hertogenbosch",
"name:ar": "سيرتوخيمبوس",
"name:carnaval": "Oeteldonk",
"name:de": "Herzogenbusch",
"name:es": "Bolduque",
"name:fr": "Bois-le-Duc",
"name:fy": "De Bosk",
"name:id": "Den Bosch",
"name:la": "Silva Ducis",
"name:li": "De Bósj",
"name:lt": "Hertogenbosas",
"name:mk": "Хертогенбос",
"name:nds": "Den Bosch",
"name:ru": "Хертогенбос",
"name:sr": "Хертогенбос",
"name:uk": "Гертогенбос",
"name:zh": "斯海尔托亨博斯",
"place": "city",
"population": "115903",
"population:date": "2017-01-01",
"population:note": "Inwonertal gemeente minus Rosmalen, Nuland en Vinkel.",
"source:population": "https://www.s-hertogenbosch.nl",
"website": "https://www.s-hertogenbosch.nl/",
"wikidata": "Q2766547",
"wikipedia": "nl:'s-Hertogenbosch"
}
}

+ 0
- 32
test/fixtures/input/eindhoven_city.json View File

@@ -1,32 +0,0 @@
{
"type": "Feature",
"id": "42616340",
"geometry": {
"type": "Point",
"coordinates": [
5.478633,
51.4392648
]
},
"properties": {
"name": "Eindhoven",
"name:carnaval": "Lampegat",
"name:el": "Αϊντχόφεν",
"name:he": "איינדהובן",
"name:la": "Endhovia",
"name:lt": "Eindhovenas",
"name:mk": "Ајндховен",
"name:ru": "Эйндховен",
"name:sr": "Ајндховен",
"name:uk": "Ейндговен",
"name:zh": "埃因霍温",
"place": "city",
"population": "226921",
"population:date": "2017-01-01",
"population:note": "Inwonertal inclusief Kerkdorp Acht",
"source:population": "https://eindhoven.incijfers.nl",
"website": "https://www.eindhoven.nl/",
"wikidata": "Q9832",
"wikipedia": "nl:Eindhoven"
}
}

+ 0
- 16
test/fixtures/input/ekoplaza_arnhem.json View File

@@ -1,16 +0,0 @@
{
"type": "Feature",
"id": "3210878424",
"geometry": {
"type": "Point",
"coordinates": [
5.9112061,
51.983185
]
},
"properties": {
"name": "Ekoplaza",
"shop": "supermarket",
"wheelchair": "yes"
}
}

+ 0
- 24
test/fixtures/input/hacked.json View File

@@ -1,24 +0,0 @@
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
5.8653234,
51.8473397
]
},
"properties": {
"addr:city": "Nijmegen",
"addr:country": "NL",
"addr:housenumber": "1",
"addr:postcode": "<script>alert('1000AB');</script>",
"addr:street": "Burchtstraat\n",
"name": "H@ckedM",
"opening_hours": "this 10s! unparsable 18:00+",
"shop": "clothes",
"shop:number": "NL0050",
"source": "BAG;http://www.hm.com/nl/",
"source:date": "2014-05-07",
"wheelchair": "yes"
}
}

+ 0
- 24
test/fixtures/input/jan_de_groot_shertogenbosch.json View File

@@ -1,24 +0,0 @@
{
"type": "Feature",
"id": "945471470",
"geometry": {
"type": "Point",
"coordinates": [
5.2966174,
51.690227
]
},
"properties": {
"addr:city": "'s-Hertogenbosch",
"addr:housenumber": "24",
"addr:postcode": "5211TW",
"addr:street": "Stationsweg",
"name": "Jan de Groot",
"shop": "bakery",
"source": "BAG",
"source:date": "2014-02-11",
"toilets:wheelchair": "no",
"website": "https://www.bosschebollen.nl/",
"wheelchair": "limited"
}
}

+ 0
- 1
test/fixtures/input/region_nijmegen.json View File

@@ -1 +0,0 @@
{"type":"FeatureCollection","geocoding":{"version":"0.1.0","query":""},"features":[{"type":"Feature","geometry":{"coordinates":[5.8634696,51.8427385],"type":"Point"},"properties":{"geocoding":{"id":"admin:osm:relation:1201020","type":"zone","zone_type":"city","label":"Nijmegen","name":"Nijmegen","postcode":null,"city":null,"citycode":"","level":8,"administrative_regions":[],"codes":[{"name":"ref:gemeentecode","value":"268"},{"name":"wikidata","value":"Q47887"}],"bbox":[5.7576206,51.7905891,5.9083469,51.8946209]}}}]}

+ 0
- 23
test/fixtures/input/zuidwolde_bb.json View File

@@ -1,23 +0,0 @@
{
"type": "Feature",
"id": "2754051107",
"geometry": {
"type": "Point",
"coordinates": [
6.5941314,
53.2602521
]
},
"properties": {
"addr:city": "Zuidwolde",
"addr:housenumber": "8",
"addr:postcode": "9785AE",
"addr:street": "Oosterseweg",
"guest_house": "bed_and_breakfast",
"name": "Bed en brood 'Irene'",
"phone": "+31 6 51961751",
"source": "BAG",
"source:date": "2014-03-24",
"tourism": "guest_house"
}
}

+ 0
- 25
test/fixtures/input/zuidwolde_dr_region.json View File

@@ -1,25 +0,0 @@
{
"type": "Feature",
"id": "3523151185",
"geometry": {
"type": "Point",
"coordinates": [
6.4317343,
52.6749542
]
},
"properties": {
"is_in:continent": "Europe",
"is_in:country": "The Netherlands",
"is_in:country_code": "NL",
"name": "Zuidwolde",
"name:ru": "Зёйдволде",
"place": "village",
"population": "6240",
"population:date": "2017-01-01",
"postal_code": "7921",
"source:population": "CBS Wijk 2017",
"wikidata": "Q2754055",
"wikipedia": "nl:Zuidwolde (Drenthe)"
}
}

+ 0
- 16
test/fixtures/input/zuidwolde_fastfood.json View File

@@ -1,16 +0,0 @@
{
"type": "Feature",
"id": "2311319392",
"geometry": {
"type": "Point",
"coordinates": [
6.5921197,
53.260827
]
},
"properties": {
"amenity": "fast_food",
"name": "Moeke Vaatstra",
"wheelchair": "limited"
}
}

+ 0
- 21
test/fixtures/input/zuidwolde_gn_region.json View File

@@ -1,21 +0,0 @@
{
"type": "Feature",
"id": "48298240",
"geometry": {
"type": "Point",
"coordinates": [
6.5918683,
53.2607348
]
},
"properties": {
"is_in": "NL",
"name": "Zuidwolde",
"name:ru": "Зёйдволде",
"place": "village",
"population": "1010",
"population:date": "2017-01-01",
"postal_code": "9785",
"source:population": "CBS Buurt 2017"
}
}

+ 0
- 16
test/fixtures/input/zuidwolde_grillroom.json View File

@@ -1,16 +0,0 @@
{
"type": "Feature",
"id": "2599631016",
"geometry": {
"type": "Point",
"coordinates": [
6.4295856,
52.6714759
]
},
"properties": {
"amenity": "restaurant",
"cuisine": "kebab",
"name": "Grillroom Yusuf"
}
}

+ 0
- 74
test/fixtures/output/hm_burchtstraat.json View File

@@ -1,74 +0,0 @@
{
"data": {
"id": "9ae7f8f1-164d-4145-b472-d7c7da05a679",
"type": "place",
"attributes": {
"place_id": "9F37RV00+;shop:clothes;hm",
"name": "H&M",
"lat": 51.8473397,
"lon": 5.8653234,
"status": "open",
"open_this_week": {
"1": [
{
"start": "1989-11-06 10:00:00 +0100",
"end": "1989-11-06 18:00:00 +0100"
}
],
"2": [
{
"start": "1989-11-07 10:00:00 +0100",
"end": "1989-11-07 18:00:00 +0100"
}
],
"3": [
{
"start": "1989-11-08 10:00:00 +0100",
"end": "1989-11-08 18:00:00 +0100"
}
],
"4": [
{
"start": "1989-11-09 10:00:00 +0100",
"end": "1989-11-09 21:00:00 +0100"
}
],
"5": [
{
"start": "1989-11-10 10:00:00 +0100",
"end": "1989-11-10 18:00:00 +0100"
}
],
"6": [
{
"start": "1989-11-11 09:30:00 +0100",
"end": "1989-11-11 17:30:00 +0100"
}
],
"0": [
{
"start": "1989-11-12 12:00:00 +0100",
"end": "1989-11-12 17:30:00 +0100"
}
]
},
"raw_opening_hours": "Mo-We 10:00-18:00; Th 10:00-21:00; Fr 10:00-18:00; Sa 09:30-17:30; Su 12:00-17:30",
"website": null,
"address": {
"postcode": "6511RA",
"city": "Nijmegen",
"housenumber": "1",
"street": "Burchtstraat"
}
},
"relationships": {
"region": { "links": { "self": "/in/nijmegen" } }
},
"links": {
"self": "/places/9ae7f8f1-164d-4145-b472-d7c7da05a679"
},
"meta": {
"copyright": "OpenStreetMap-contributors"
}
}
}

+ 0
- 70
test/fixtures/output/places.json View File

@@ -1,70 +0,0 @@
{
"links": {
"self" : "/places",
"first": "/places?page=1",
"last": "/places?page=1",
"prev": null,
"next": null
},
"data": [
{
"links" : {
"self" : "/places/:UUID"
},
"meta" : {
"copyright" : "OpenStreetMap-contributors"
},
"type" : "place",
"attributes" : {
"place_id": "9F37RV00+;shop:clothes;hm",
"raw_opening_hours" : "Mo-We 10:00-18:00; Th 10:00-21:00; Fr 10:00-18:00; Sa 09:30-17:30; Su 12:00-17:30",
"open_this_week" : {
"1": [{
"start" : "1989-11-06 10:00:00 +0100",
"end" : "1989-11-06 18:00:00 +0100"
}],
"2": [{
"start" : "1989-11-07 10:00:00 +0100",
"end" : "1989-11-07 18:00:00 +0100"
}],
"3": [{
"start" : "1989-11-08 10:00:00 +0100",
"end" : "1989-11-08 18:00:00 +0100"
}],
"4": [{
"start" : "1989-11-09 10:00:00 +0100",
"end" : "1989-11-09 21:00:00 +0100"
}],
"5": [{
"start" : "1989-11-10 10:00:00 +0100",
"end" : "1989-11-10 18:00:00 +0100"
}],
"6": [{
"start" : "1989-11-11 09:30:00 +0100",
"end" : "1989-11-11 17:30:00 +0100"
}],
"0": [{
"start": "1989-11-12 12:00:00 +0100",
"end": "1989-11-12 17:30:00 +0100"
}]
},
"name" : "H&M",
"status" : "open",
"website": null,
"lat": 51.8473397,
"lon": 5.8653234,
"address" : {
"postcode" : "6511RA",
"city" : "Nijmegen",
"housenumber" : "1",
"street" : "Burchtstraat"
}
},
"relationships": {
"region": { "links": { "self": "/in/nijmegen" } }
},
"id" : "1337"
}
]
}


+ 0
- 1
test/integration/api/add_places_test.rb View File

@@ -1,7 +1,6 @@
# frozen_string_literal: true

require 'test_helper'
require_relative Hours.base_path.join('test/support/workflows/add_region.rb')

describe 'add place' do
before { skip 'Reimplement a create that posts to bragi' }

+ 0
- 2
test/integration/web/view_places_test.rb View File

@@ -3,8 +3,6 @@
require 'test_helper'
require 'timecop'

require_relative Hours.base_path.join('test/support/workflows/add_place.rb')

describe 'web view places' do
include WebTestHelpers


+ 0
- 83
test/support/workflows/add_place.rb View File

@@ -1,83 +0,0 @@
# frozen_string_literal: true

module Workflows
module AddPlace
attr_reader :aggregate_id
alias hm_id aggregate_id

def setup
super
import_geojson
end

protected

def input
[]
end

def default_centroid
GeoRuby::SimpleFeatures::Point.from_coordinates(0, 0)
end

def list_of_geojson(amount, centroid = default_centroid)
coords = centroid.dup

Array.new(amount) do |i|
coords.x += diff_x(amount)
coords.y += diff_y(amount)
{ type: 'Feature',
geometry: { type: 'Point', coordinates: coords.to_xy },
properties: {
name: "place ##{i} #{Digest::SHA1.hexdigest(i.to_s)}"
} }
end
end

def import_geojson
create_events
process_events
end

def create_events
input.each do |place_geojson|
command = Hours::AddPlaceCommand.build(place_geojson)
Hours::CommandHandler.new.handle(command)
@aggregate_id ||= command.aggregate_id.to_s
end
end

def process_events
Hours.event_source.each_by_range(0, 1) do |event|
esps.each do |ep|
ep.process(event)
end
end
end

def projector
@projector ||= Hours::Projections::Places::Projector.new
end

def place_id
place = Hours::Aggregates::Place.new(SecureRandom.uuid, [])
place.add(json_fixtures('input/hm_burchtstraat.json')).place_id
end

private

def esps
@esps = [Hours::Projections::Places::Projector.new]
end

def diff_x(amount)
# substract 0.001 to avoid rounding errors tipping points over the
# envelope border
Hours::Projections::BaseQuery::BUFFERX / (amount - 0.001)
end

def diff_y(amount)
Hours::Projections::BaseQuery::BUFFERY / (amount - 0.001)
end
end
end

+ 0
- 51
test/support/workflows/add_region.rb View File

@@ -1,51 +0,0 @@
# frozen_string_literal: true

module Workflows
##
# Workflow to add a region (city) to the projection
#
# TODO: DRY with AddPlace. Lots of similarities.
class AddRegion
attr_reader :test_obj

def initialize(test_obj)
@test_obj = test_obj
end

def call
import_geojson
end

protected

def regions
test_obj.class.method_defined?(:regions) ? test_obj.regions : []
end

def import_geojson
create_events
process_events
end

def create_events
regions.each do |location_geojson|
command = Hours::AddRegionCommand.build(location_geojson)
Hours::CommandHandler.new.handle(command)
end
end

def process_events
Hours.event_source.each_by_range(0, 1) do |event|
esps.each do |ep|
ep.process(event)
end
end
end

private

def esps
@esps ||= [Hours::Projections::Regions::Projector.new]
end
end
end

Loading…
Cancel
Save