testdata 1.1.3 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +6 -1
- data.tar.gz.sig +0 -0
- data/lib/testdata.rb +40 -15
- metadata +51 -48
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7cf7b1c61241032094b96f7dd7b35451a0ea5d6adbd8a82301dc7205a15279ae
|
4
|
+
data.tar.gz: 9dd7d90fde6a9b3287eeaf52d142300feeb6dff1c650221fabed4129f92b0ffa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b075f26248e733a201a4f30f0812b54540c5233625039dd4a8e376d20b0968da2758b63d686c7574e1eb53d815a19bad9504734a3e38ce447cf0f8658de04d8b
|
7
|
+
data.tar.gz: 756309f4520e95053f0dd45ab1b6e659682a20435768c21a225f5382328be1b8787bc1ac5a83f638646c3246fe7d4274ef219be6d73555436a395d04ec081528
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,6 @@
|
|
1
|
-
|
1
|
+
e
|
2
|
+
ÿ|��ݨI�iK���g�]����*f��w�qy�WȬh*ĥn�_��=�5ƅYe�����ı�a�ݶ[vǝ��,.�a�J�'
|
3
|
+
����iI?ҳ<>��R��"�c� R��#�� д�Tja��
|
4
|
+
n�[��3g�{�a�h���F5PU�ف��H���Qy��`� ���>�:�zJC]iLIvf#�N��_�j��f�������*
|
5
|
+
�Jn'��^�6�8��?��Ѱͱ��tj��L��9�\��%����c%u/���X��
|
6
|
+
�yٮ1��UK��>Iq���F`�� �.�~ߗ��`��]ٮ̀� ��w=L�!�M3uf�*1��ā�C���fy,�gG���s������c��Q8��~�L�m
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/testdata.rb
CHANGED
@@ -6,6 +6,7 @@ require 'app-routes'
|
|
6
6
|
require 'testdata_text'
|
7
7
|
require 'diffy'
|
8
8
|
require 'polyrex'
|
9
|
+
require 'yaml'
|
9
10
|
|
10
11
|
|
11
12
|
class TestdataException < Exception
|
@@ -54,6 +55,15 @@ module Testdata
|
|
54
55
|
|
55
56
|
def run(raw_x=nil, debug2=nil)
|
56
57
|
|
58
|
+
# verify the document has unique path numbers
|
59
|
+
|
60
|
+
a = @doc.root.xpath('records/test/summary/path/text()')
|
61
|
+
duplicates = a.select{ |e| a.count(e) > 1 }.uniq
|
62
|
+
|
63
|
+
if duplicates.any? then
|
64
|
+
raise 'Duplicate path found. Path: ' + duplicates.inspect
|
65
|
+
end
|
66
|
+
|
57
67
|
@debug2 = debug2 ? true : false
|
58
68
|
@success = []
|
59
69
|
|
@@ -63,8 +73,9 @@ module Testdata
|
|
63
73
|
else
|
64
74
|
raw_x
|
65
75
|
end
|
66
|
-
|
67
|
-
procs = {NilClass: :test_all, Range: :test_range, String: :test_id,
|
76
|
+
|
77
|
+
procs = {NilClass: :test_all, Range: :test_range, String: :test_id,
|
78
|
+
Integer: :test_id, Fixnum: :test_id}
|
68
79
|
|
69
80
|
method(procs[x.class.to_s.to_sym]).call(x)
|
70
81
|
summary()
|
@@ -73,26 +84,24 @@ module Testdata
|
|
73
84
|
private
|
74
85
|
|
75
86
|
def testdata_values(id)
|
76
|
-
|
77
|
-
node = @doc.root.element "records/test[summary/path='#{id}']"
|
78
87
|
|
88
|
+
node = @doc.root.element "records/test[summary/path='#{id}']"
|
79
89
|
raise TestdataException, "Path error: node title not found" unless node
|
80
90
|
|
81
91
|
path_no = node.text('summary/path')
|
82
|
-
|
92
|
+
|
83
93
|
input_summary = node.element 'records/input/summary'
|
84
94
|
input_summary.delete 'schema | format_mask | recordx_type'
|
85
95
|
|
86
|
-
#puts 'node : ' + node.xml.inspect
|
87
96
|
input_nodes = input_summary.xpath('*') #[1..-1]
|
88
|
-
|
89
|
-
input_values = input_nodes.map{|x| x.texts.join.strip} + []
|
90
|
-
|
97
|
+
input_values = input_nodes.map{|x| x.texts.map(&:unescape).join.strip}
|
91
98
|
input_names = input_nodes.map(&:name)
|
99
|
+
|
92
100
|
raise TestdataException, 'inputs not found' if input_values.empty? \
|
93
101
|
or input_names.empty?
|
94
102
|
|
95
103
|
summary = node.element 'summary'
|
104
|
+
|
96
105
|
type, desc = summary.text('type'), summary.text('description')
|
97
106
|
|
98
107
|
output_summary = node.element 'records/output/summary'
|
@@ -109,12 +118,25 @@ module Testdata
|
|
109
118
|
x ||=(0..-1)
|
110
119
|
|
111
120
|
break_on_fail = @doc.root.element('summary/break_on_fail/text()') == 'true'
|
121
|
+
|
122
|
+
test_id = nil
|
112
123
|
|
113
|
-
|
124
|
+
begin
|
125
|
+
|
126
|
+
@doc.root.xpath("records/test/summary/path/text()")[x].each do |id|
|
127
|
+
|
128
|
+
test_id = id
|
129
|
+
puts 'testing id: ' + id.inspect
|
130
|
+
result = test_id(id)
|
131
|
+
break if result == false and break_on_fail
|
132
|
+
|
133
|
+
end
|
134
|
+
|
135
|
+
rescue
|
114
136
|
|
115
|
-
|
116
|
-
break if result == false and break_on_fail
|
137
|
+
@success << [false, test_id.to_i]
|
117
138
|
end
|
139
|
+
|
118
140
|
|
119
141
|
end
|
120
142
|
|
@@ -124,6 +146,7 @@ module Testdata
|
|
124
146
|
path_no, inputs, input_names, type, expected, @desc =
|
125
147
|
testdata_values(id.to_s)
|
126
148
|
@inputs = inputs
|
149
|
+
|
127
150
|
tests() # load the routes
|
128
151
|
|
129
152
|
raw_actual = run_route type
|
@@ -182,7 +205,7 @@ module Testdata
|
|
182
205
|
end
|
183
206
|
|
184
207
|
def read_rdx(buffer)
|
185
|
-
|
208
|
+
puts 'inside read_rdf: buffer: ' + buffer.inspect
|
186
209
|
dx = Dynarex.new
|
187
210
|
dx.import buffer
|
188
211
|
|
@@ -207,7 +230,8 @@ module Testdata
|
|
207
230
|
|
208
231
|
px.create.test(path: (i+1).to_s, type: dx.test_type) do |create|
|
209
232
|
|
210
|
-
raw_inputs.each do |fld_in|
|
233
|
+
raw_inputs.each do |fld_in|
|
234
|
+
|
211
235
|
create.input(fld_in[0..-4].to_sym => \
|
212
236
|
x.method(fld_in.to_sym).call)
|
213
237
|
end
|
@@ -241,6 +265,7 @@ module Testdata
|
|
241
265
|
end
|
242
266
|
|
243
267
|
def read_td(buffer)
|
268
|
+
puts 'buffer: ' + buffer
|
244
269
|
TestdataText.parse buffer
|
245
270
|
end
|
246
271
|
|
@@ -318,4 +343,4 @@ end
|
|
318
343
|
|
319
344
|
end
|
320
345
|
end
|
321
|
-
end
|
346
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testdata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,28 +10,32 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkxMDA3MDk0MTU2WhcN
|
15
|
+
MjAxMDA2MDk0MTU2WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC2E/7O
|
17
|
+
uQtS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wAa/tzPKKpbzEFjuUdTs0
|
32
|
+
ByW7I/n/h2fQkhR+/hbzh/xzCuRatkvUkAHmtW1StGSbPn0Hoam6hwWp+NuuUfEU
|
33
|
+
tA2AMgGW5/Ft/vBLFyCfMr/9x6QJEW3VtfwqL8zie4jp2sVCrW1gdotA3+4XdaEF
|
34
|
+
fUI/y8o+W/4oN7aCyhUzCXTSlGzwEHLqqCYX3DFerUd+mdQhSNLYAQuJtj/4zoNc
|
35
|
+
U1Tt/KPr9FeWlvj5ihis4H6UPWZxY2G9k94y2W7ylWkcKNXR8i45F+nCzDL3W0Ll
|
36
|
+
Vt/9GDfEI95Jg3QNvXMDdzNf
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2020-09-03 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
36
40
|
- !ruby/object:Gem::Dependency
|
37
41
|
name: app-routes
|
@@ -42,7 +46,7 @@ dependencies:
|
|
42
46
|
version: '0.1'
|
43
47
|
- - ">="
|
44
48
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.1.
|
49
|
+
version: 0.1.19
|
46
50
|
type: :runtime
|
47
51
|
prerelease: false
|
48
52
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -52,69 +56,69 @@ dependencies:
|
|
52
56
|
version: '0.1'
|
53
57
|
- - ">="
|
54
58
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.1.
|
59
|
+
version: 0.1.19
|
56
60
|
- !ruby/object:Gem::Dependency
|
57
61
|
name: testdata_text
|
58
62
|
requirement: !ruby/object:Gem::Requirement
|
59
63
|
requirements:
|
60
|
-
- - "~>"
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0.1'
|
63
64
|
- - ">="
|
64
65
|
- !ruby/object:Gem::Version
|
65
|
-
version: 0.
|
66
|
+
version: 0.2.0
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0.2'
|
66
70
|
type: :runtime
|
67
71
|
prerelease: false
|
68
72
|
version_requirements: !ruby/object:Gem::Requirement
|
69
73
|
requirements:
|
70
|
-
- - "~>"
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version: '0.1'
|
73
74
|
- - ">="
|
74
75
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
76
|
+
version: 0.2.0
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0.2'
|
76
80
|
- !ruby/object:Gem::Dependency
|
77
81
|
name: diffy
|
78
82
|
requirement: !ruby/object:Gem::Requirement
|
79
83
|
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.0'
|
83
84
|
- - ">="
|
84
85
|
- !ruby/object:Gem::Version
|
85
|
-
version: 3.0
|
86
|
+
version: 3.4.0
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.4'
|
86
90
|
type: :runtime
|
87
91
|
prerelease: false
|
88
92
|
version_requirements: !ruby/object:Gem::Requirement
|
89
93
|
requirements:
|
90
|
-
- - "~>"
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
version: '3.0'
|
93
94
|
- - ">="
|
94
95
|
- !ruby/object:Gem::Version
|
95
|
-
version: 3.0
|
96
|
+
version: 3.4.0
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '3.4'
|
96
100
|
- !ruby/object:Gem::Dependency
|
97
101
|
name: polyrex
|
98
102
|
requirement: !ruby/object:Gem::Requirement
|
99
103
|
requirements:
|
100
104
|
- - "~>"
|
101
105
|
- !ruby/object:Gem::Version
|
102
|
-
version: '1.
|
106
|
+
version: '1.3'
|
103
107
|
- - ">="
|
104
108
|
- !ruby/object:Gem::Version
|
105
|
-
version: 1.
|
109
|
+
version: 1.3.1
|
106
110
|
type: :runtime
|
107
111
|
prerelease: false
|
108
112
|
version_requirements: !ruby/object:Gem::Requirement
|
109
113
|
requirements:
|
110
114
|
- - "~>"
|
111
115
|
- !ruby/object:Gem::Version
|
112
|
-
version: '1.
|
116
|
+
version: '1.3'
|
113
117
|
- - ">="
|
114
118
|
- !ruby/object:Gem::Version
|
115
|
-
version: 1.
|
119
|
+
version: 1.3.1
|
116
120
|
description:
|
117
|
-
email: james@
|
121
|
+
email: james@jamesrobertson.eu
|
118
122
|
executables: []
|
119
123
|
extensions: []
|
120
124
|
extra_rdoc_files: []
|
@@ -139,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
143
|
- !ruby/object:Gem::Version
|
140
144
|
version: '0'
|
141
145
|
requirements: []
|
142
|
-
|
143
|
-
rubygems_version: 2.4.8
|
146
|
+
rubygems_version: 3.0.3
|
144
147
|
signing_key:
|
145
148
|
specification_version: 4
|
146
|
-
summary:
|
149
|
+
summary: A test framework which accepts test data in a Polyrex format.
|
147
150
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|