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())
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())
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())
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())
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())
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())