Example #1
0
    def test_products_absent(self):
        SAMPLE_SCALAR = """
description: A nice one-line description.
expires: never
record_in_processes:
  - 'main'
kind: uint
notification_emails:
  - [email protected]
bug_numbers:
  - 12345
"""

        scalar = load_scalar(SAMPLE_SCALAR)
        parse_scalars.ScalarType("CATEGORY", "PROVE", scalar, strict_type_checks=True)
        self.assertRaises(SystemExit, ParserError.exit_func)
Example #2
0
    def test_invalid_email_address(self):
        SAMPLE_SCALAR_INVALID_ADDRESSES = """
description: A nice one-line description.
expires: never
record_in_processes:
  - 'main'
kind: uint
notification_emails:
  - [email protected], [email protected]
products: ["firefox"]
bug_numbers:
  - 12345
"""
        scalar = load_scalar(SAMPLE_SCALAR_INVALID_ADDRESSES)
        parse_scalars.ScalarType("CATEGORY", "PROVE", scalar, strict_type_checks=True)

        self.assertRaises(SystemExit, ParserError.exit_func)
Example #3
0
    def test_multistore_default(self):
        SAMPLE_SCALAR = """
description: A nice one-line description.
expires: never
record_in_processes:
  - 'main'
kind: uint
notification_emails:
  - [email protected]
bug_numbers:
  - 12345
"""
        scalar = load_scalar(SAMPLE_SCALAR)
        sclr = parse_scalars.ScalarType("CATEGORY",
                                        "PROVE",
                                        scalar,
                                        strict_type_checks=True)
        ParserError.exit_func()

        self.assertEqual(sclr.record_into_store, ["main"])
Example #4
0
    def test_operating_systems_default(self):
        SAMPLE_SCALAR = """
description: A nice one-line description.
expires: never
record_in_processes:
  - 'main'
kind: uint
notification_emails:
  - [email protected]
products: ["firefox"]
bug_numbers:
  - 12345
"""
        scalar = load_scalar(SAMPLE_SCALAR)
        sclr = parse_scalars.ScalarType(
            "CATEGORY", "PROVE", scalar, strict_type_checks=True
        )
        ParserError.exit_func()

        self.assertEqual(sclr.operating_systems, ["all"])
Example #5
0
    def test_valid_email_address(self):
        SAMPLE_SCALAR_VALID_ADDRESSES = """
description: A nice one-line description.
expires: never
record_in_processes:
  - 'main'
kind: uint
notification_emails:
  - [email protected]
  - [email protected]
bug_numbers:
  - 12345
"""
        scalar = load_scalar(SAMPLE_SCALAR_VALID_ADDRESSES)
        sclr = parse_scalars.ScalarType("CATEGORY",
                                        "PROVE",
                                        scalar,
                                        strict_type_checks=True)

        self.assertEqual(sclr.notification_emails,
                         ["*****@*****.**", "*****@*****.**"])