Example #1
0
def test_dtd_entity_with_quotes():
    quality_check_args = mock_quality_check_args(
        resource_path='strings.dtd',
        key='test',
        string='<a href="http://mozilla.org">Mozilla</a>',
        comment='Some comment',
        translation='<a href="http://mozilla.org">Mozilla "2018"</a>',
    )
    assert run_checks(**quality_check_args) == {}
def test_dtd_entity_with_quotes():
    quality_check_args = mock_quality_check_args(
        resource_path="strings.dtd",
        key="test",
        string='<a href="http://mozilla.org">Mozilla</a>',
        comment="Some comment",
        translation='<a href="http://mozilla.org">Mozilla "2018"</a>',
    )
    assert run_checks(**quality_check_args) == {}
def test_dtd_source_string_with_quotes():
    """
    A correct source string with quotes shouldn't raise a warning.
    """
    quality_check_args = mock_quality_check_args(
        resource_path="mobile/android/base/android_strings.dtd",
        key="test",
        string='Mozilla "2017"',
        comment="Some comment",
        translation='Mozilla "2018"',
    )
    assert run_checks(**quality_check_args) == {}
Example #4
0
def test_dtd_source_string_with_quotes():
    """
    A correct source string with quotes shouldn't raise a warning.
    """
    quality_check_args = mock_quality_check_args(
        resource_path='mobile/android/base/android_strings.dtd',
        key='test',
        string='Mozilla "2017"',
        comment='Some comment',
        translation='Mozilla "2018"',
    )
    assert run_checks(**quality_check_args) == {}
def test_invalid_ftl_translations(quality_check_args, failed_checks):
    assert run_checks(**quality_check_args) == failed_checks
def test_valid_translations(quality_check_args):
    """
    Quality check should return an empty dict if there's no errors.
    """
    assert run_checks(**quality_check_args) == {}
Example #7
0
def test_invalid_ftl_translations(quality_check_args, failed_checks):
    assert run_checks(**quality_check_args) == failed_checks
Example #8
0
def test_valid_translations(quality_check_args):
    """
    Quality check should return an empty dict if there's no errors.
    """
    assert run_checks(**quality_check_args) == {}