def testScalarSamePageMerging(self):
    page0 = self.pages[0]
    v0 = scalar.ScalarValue(page0, 'x', 'unit', 1,
                            description='important metric',
                            improvement_direction=improvement_direction.UP)
    v1 = scalar.ScalarValue(page0, 'x', 'unit', 2,
                            description='important metric',
                            improvement_direction=improvement_direction.UP)
    self.assertTrue(v1.IsMergableWith(v0))

    vM = scalar.ScalarValue.MergeLikeValuesFromSamePage([v0, v1])
    self.assertEquals(page0, vM.page)
    self.assertEquals('x', vM.name)
    self.assertEquals('unit', vM.units)
    self.assertEquals('important metric', vM.description)
    self.assertEquals(True, vM.important)
    self.assertEquals([1, 2], vM.values)
    self.assertEquals(improvement_direction.UP, vM.improvement_direction)