예제 #1
0
def test_boolean_scalar(add_response):
    name, value = 'telemetry.test.boolean_kind', True
    scalar = Scalar(name, value)

    assert scalar.get_value() == value
    assert scalar.get_name() == name
    assert scalar.get_definition().get('kind') == 'boolean'
    assert Scalar.REQUIRED_FIELDS.issubset(scalar.get_definition().viewkeys())
예제 #2
0
def test_string_scalar(add_response):
    name, value = 'telemetry.test.string_kind', 'string'
    scalar = Scalar(name, value)

    assert scalar.get_value() == value
    assert scalar.get_name() == name
    assert scalar.get_definition().get('kind') == 'string'
    assert Scalar.REQUIRED_FIELDS.issubset(scalar.get_definition().viewkeys())
예제 #3
0
def test_int_scalar(add_response):
    name, value = 'telemetry.test.unsigned_int_kind', 8
    scalar = Scalar(name, value)

    assert scalar.get_value() == value
    assert scalar.get_name() == name
    assert scalar.get_definition().get('kind') == 'uint'
    assert Scalar.REQUIRED_FIELDS.issubset(scalar.get_definition().viewkeys())
예제 #4
0
def test_release_channel(add_response):
    name, value = 'telemetry.test.unsigned_int_kind', 8
    scalar = Scalar(name, value, channel='release')

    assert scalar.get_value() == value
    assert scalar.get_name() == name
    assert Scalar.REQUIRED_FIELDS.issubset(scalar.get_definition().viewkeys())
예제 #5
0
def test_release_revision(add_response):
    name, value = 'telemetry.test.unsigned_int_kind', 8
    scalar = Scalar(name, value,
                    revision='https://hg.mozilla.org/releases/mozilla-release/rev/tip')

    assert scalar.get_value() == value
    assert scalar.get_name() == name
    assert Scalar.REQUIRED_FIELDS.issubset(scalar.get_definition().viewkeys())
예제 #6
0
def test_cache(add_response):
    name, value = 'telemetry.test.unsigned_int_kind', 8
    Scalar(name, value)
    scalar_2 = Scalar(name, value)

    assert scalar_2.get_value() == value
    assert scalar_2.get_name() == name
    assert Scalar.REQUIRED_FIELDS.issubset(scalar_2.get_definition().viewkeys())