-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bdd/3350-value-types
- Loading branch information
Showing
8 changed files
with
255 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Filesystem Carriage Mechanism | ||
============================= | ||
|
||
The filesystem carriage mechanism writes produced documents to the filesystem and consumes documents from the filesystem. Along with the documents, it writes a manifest file named according to the format `manifest_<sequence identifier>.txt`. Documents are named following the format `<sequence identifier>_<sequence number>.xml`. | ||
|
||
Each time a document is written to the file system, a line using the following format is appended to the manifest file: | ||
|
||
`availability_time,path_to_xml_file` | ||
|
||
For example: | ||
|
||
`09:20:31.279,TestSequence1_474.xml` | ||
|
||
The format is `hh:mm:ss.fff,path` where `fff` represents milliseconds digits. | ||
|
||
The manifest file gives the availability time for each document along with the path to the corresponding document. The timeline used for the availability times is the same as the one used in the documents, indeed the carriage implementation uses the same clock (or time reference) as the node that produces the documents. The writing order and thus the reading order is from top to bottom. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@validation @syntax @sequence @xsd | ||
Feature: Facet | ||
Rules on use of ebuttm:facet and ebuttm:documentFacet | ||
|
||
|
||
# SPEC-CONFORMANCE: R26 R66 R67 | ||
# skipped because the semantic validation does not check facets yet | ||
@skip | ||
Scenario: Invalid term identifier | ||
Given an xml file <xml_file> | ||
When it has facet1 applied to element <parent1> | ||
And facet1 has attribute <link1> | ||
And facet1 contains string <term1> | ||
And it has facet2 applied to element <parent2> | ||
And facet2 has attribute <link2> | ||
And facet2 contains string <term2> | ||
Then document is invalid | ||
|
||
Examples: | ||
| xml_file | parent1 | link1 | term1 | parent2 | link2 | term2 | | ||
| facet.xml | body | http://link1.com | string1 | body | http://link1.com | string1 | | ||
|
||
|
||
Scenario: Valid term identifier | ||
Given an xml file <xml_file> | ||
When it has facet1 applied to element <parent1> | ||
And facet1 has attribute <link1> | ||
And facet1 contains string <term1> | ||
And it has facet2 applied to element <parent2> | ||
And facet2 has attribute <link2> | ||
And facet2 contains string <term2> | ||
Then document is valid | ||
|
||
Examples: | ||
| xml_file | parent1 | link1 | term1 | parent2 | link2 | term2 | | ||
| facet.xml | body | http://link1.com | string1 | div | http://link1.com | string1 | | ||
| facet.xml | p | http://link1.com | string1 | p | http://link2.com | string2 | | ||
| facet.xml | span | http://link1.com | string1 | span | http://link1.com | string2 | | ||
|
||
|
||
# SPEC-CONFORMANCE: R27 R28 R29 R30 | ||
Scenario: Valid Facet Summary | ||
Given an xml file <xml_file> | ||
When it has element facet1 with attribute <expresses1> | ||
And it has element facet2 with attribute <expresses2> | ||
And it has element facet3 with attribute <expresses3> | ||
And documentFacet has atribute <summary> | ||
Then document is valid | ||
|
||
Examples: | ||
| xml_file | expresses1 | expresses2 | expresses3 | summary | | ||
| facet.xml | has | has | has | all_has | | ||
| facet.xml | has_not | has_not | has_not | all_has_not | | ||
| facet.xml | has | has_not | has | mixed | | ||
| facet.xml | unknown | has | has | mixed | | ||
| facet.xml | | | | unspecified | | ||
| facet.xml | unknown | unknown | unknown | unspecified | | ||
|
||
|
||
Scenario: Invalid Facet Summary | ||
Given an xml file <xml_file> | ||
When it has element facet1 with attribute <expresses1> | ||
And it has element facet2 with attribute <expresses2> | ||
And it has element facet3 with attribute <expresses3> | ||
And documentFacet has atribute <summary> | ||
Then document is invalid | ||
|
||
Examples: | ||
| xml_file | expresses1 | expresses2 | expresses3 | summary | | ||
| facet.xml | has_not | has_not | has_not | has | | ||
| facet.xml | has | has_not | has | has | | ||
| facet.xml | | | | has_not | | ||
| facet.xml | unknown | unknown | unknown | has | | ||
@skip # again semantic validation for that part is missing in the xml validation for now | ||
| facet.xml | has | has | has | all_has_not | | ||
| facet.xml | unknown | has | has | unspecified | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?xml version="1.0" ?> | ||
<tt:tt ebuttp:sequenceIdentifier="testSequence001" ebuttp:sequenceNumber="1" ttp:clockMode="local" ttp:timeBase="clock" xml:lang="en-GB" xmlns:ebuttm="urn:ebu:tt:metadata" xmlns:ebuttp="urn:ebu:tt:parameters" xmlns:tt="http://www.w3.org/ns/ttml" xmlns:ttp="http://www.w3.org/ns/ttml#parameter" xmlns:xml="http://www.w3.org/XML/1998/namespace"> | ||
<tt:head> | ||
<tt:metadata> | ||
{% if document_facets %} | ||
<ebuttm:documentMetadata> | ||
{{document_facets}} | ||
</ebuttm:documentMetadata> | ||
{% else %} | ||
<ebuttm:documentMetadata/> | ||
{% endif %} | ||
</tt:metadata> | ||
</tt:head> | ||
<tt:body> | ||
{% if body_facets %} | ||
<tt:metadata> | ||
{{body_facets}} | ||
</tt:metadata> | ||
{% endif %} | ||
<tt:div> | ||
{% if div_facets %} | ||
<tt:metadata> | ||
{{div_facets}} | ||
</tt:metadata> | ||
{% endif %} | ||
<tt:p xml:id="ID005"> | ||
{% if p_facets %} | ||
<tt:metadata> | ||
{{p_facets}} | ||
</tt:metadata> | ||
{% endif %} | ||
<tt:span> | ||
{% if span_facets %} | ||
<tt:metadata> | ||
{{span_facets}} | ||
</tt:metadata> | ||
{% endif %} | ||
Some example text... | ||
</tt:span> | ||
</tt:p> | ||
</tt:div> | ||
</tt:body> | ||
</tt:tt> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
from pytest_bdd import when, scenarios | ||
|
||
|
||
scenarios('features/validation/facet.feature') | ||
|
||
|
||
@when('it has facet1 applied to element <parent1>') | ||
def when_facet1_to_parent1(parent1, template_dict, test_context): | ||
test_context['parent1'] = parent1 | ||
key = parent1 + "_facets" | ||
if key in template_dict: | ||
template_dict[key] += "<ebuttm:facet" | ||
else: | ||
template_dict[key] = "<ebuttm:facet" | ||
|
||
|
||
@when('facet1 has attribute <link1>') | ||
def when_facet1_link1(link1, template_dict, test_context): | ||
key = test_context['parent1'] + "_facets" | ||
if link1: | ||
template_dict[key] += ' link="{}"'.format(link1) | ||
|
||
|
||
@when('facet1 contains string <term1>') | ||
def when_facet1_term1(term1, template_dict, test_context): | ||
key = test_context['parent1'] + "_facets" | ||
template_dict[key] += '>{}</ebuttm:facet>'.format(term1) | ||
|
||
|
||
@when('it has facet2 applied to element <parent2>') | ||
def when_facet2_to_parent2(parent2, template_dict, test_context): | ||
test_context['parent2'] = parent2 | ||
key = parent2 + "_facets" | ||
if key in template_dict: | ||
template_dict[key] += "<ebuttm:facet" | ||
else: | ||
template_dict[key] = "<ebuttm:facet" | ||
|
||
|
||
@when('facet2 has attribute <link2>') | ||
def when_facet2_link2(link2, template_dict, test_context): | ||
key = test_context['parent2'] + "_facets" | ||
if link2: | ||
template_dict[key] += ' link="{}"'.format(link2) | ||
|
||
|
||
@when('facet2 contains string <term2>') | ||
def when_facet2_term2(term2, template_dict, test_context): | ||
key = test_context['parent2'] + "_facets" | ||
template_dict[key] += '>{}</ebuttm:facet>'.format(term2) | ||
|
||
|
||
@when('it has element facet1 with attribute <expresses1>') | ||
def when_facet1_expresses1(expresses1, template_dict): | ||
value = '<ebuttm:facet' | ||
if expresses1: | ||
value += ' expresses="{}">test_facet</ebuttm:facet>'.format(expresses1) | ||
else: | ||
value += '>test_facet</ebuttm:facet>' | ||
template_dict['body_facets'] = value | ||
|
||
|
||
@when('it has element facet2 with attribute <expresses2>') | ||
def when_facet2_expresses2(expresses2, template_dict): | ||
value = '<ebuttm:facet' | ||
if expresses2: | ||
value += ' expresses="{}">test_facet</ebuttm:facet>'.format(expresses2) | ||
else: | ||
value += '>test_facet</ebuttm:facet>' | ||
template_dict['div_facets'] = value | ||
|
||
|
||
@when('it has element facet3 with attribute <expresses3>') | ||
def when_facet3_expresses3(expresses3, template_dict): | ||
value = '<ebuttm:facet' | ||
if expresses3: | ||
value += ' expresses="{}">test_facet</ebuttm:facet>'.format(expresses3) | ||
else: | ||
value += '>test_facet</ebuttm:facet>' | ||
template_dict['p_facets'] = value | ||
|
||
|
||
@when('documentFacet has atribute <summary>') | ||
def when_documentFacet_summary(summary, template_dict): | ||
template_dict['document_facets'] = '<ebuttm:documentFacet summary="{}">test_facet</ebuttm:documentFacet>'.format(summary) |