class TestScopeMeasurements(unittest.TestCase): """ Test ScopeMeasurements Class """ def clean_state(self): self.scope_measurements = None def setUp(self): self.clean_state() self.scope_measurements = ScopeMeasurements() def tearDown(self): self.clean_state() def test_status_getter(self): self.scope_measurements['status'] = "happy" self.assertEqual("happy", self.scope_measurements.status) def test_status_setter(self): self.scope_measurements.status = "happy" self.assertEqual("happy", self.scope_measurements['status']) def test_adds_measurement(self): self.scope_measurements['key'] = 'value' self.assertTrue(self.scope_measurements.has_key('key')) self.assertEqual('value', self.scope_measurements['key'])
def setUp(self): self.clean_state() self.scope_measurements = ScopeMeasurements()