blob: cfbc0e17527dc788ebb60fb6505c79aed0d384db (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
test-extraction-data
====================
The python test will traverse recursively this directory, loading the .expected files as tests.
.expected file format
=====================
It is a .ini (.desktop) formatted file with two mandatory sections: TestFile and Metadata.
The TestFile section contains the
* Filename (mandatory): relative path from the .expected of the file under test.
* Bugzilla (optional): reference to a bug related with the file.
* Comment (optional): brief description of why that file is in the test suite (problematic, format example...)
* ExpectedFailure (optional): If this key is present, we expect the extraction to fail.
If ExpectedFailure is included, it is recommended to fill the Bugzilla field!
The Metadata section contains pairs of property=values with few special rules:
1. The ':' in the properties is replaced with ̈́_'. Note that in the values is ok to have ':'.
E.G. nfo:duration=5 -> nfo_duration=5
but a=nmm:Video -> a=nmm:Video
2. If the property name is prefixed with '@' then the property is expected in the extraction, but the value
won't be checked.
E.G. The extraction is: slo:location [a slo:GeoPoint; slo:postalAddress <urn:uuid:123-123>];
@slo_location= -> PASS slo:location is in the extraction
3. If the property name is prefixed with '!' then the property is NOT expected in the extraction
If the negated property has a value, it forbids the exact value. Otherwise, it forbids the property at all.
E.G. The extraction is: a nmm:Video; nfo:duration 50.
!a=nmm:Audio -> PASS because there is no "a nmm:Audio"
!nfo_duration=12 -> PASS because duration has a different value
!nfo_duration= -> FAIL because there shouldn't be any nfo:duration at all
4. The translation of the extraction results to a python dictionary is very basic.
It handles a couple of special cases, relevant for testing:
E.G.
slo:location [a slo:GeoLocation; slo:PostalAddress "XXX"] -> slo_location_postalAddress=XXX
Note 24/08/2011: Tags are translated as "nao_Tag=value, value, value" instead of
the old "nao_Tag_preflabel=value, value, value"
5. There is (so far only) one constant defined to use in the values:
@URNUUID@ meaning an automatic generated urn:uuid:1231-123-123 URL
[This constant must not be used with multiple-valued properties. The code only check the first result.]
Example
======
Everything together should look like this:
[TestFile]
Filename=x.mp4
Bugzilla=GB#123123
Comment=Video usually clasiffied as Audio by mistake
[Metadata]
a=nmm:Video
!a=nmm:Audio
nfo_duration=123
|