def test_probe_get_all(self): values = get_fake_probe('1') probe_ref1 = db_api.probe_create(self.conf, values) probe_ref2 = db_api.probe_create(self.conf, values) probes = db_api.probe_get_all(self.conf) self.assertEqual([dict(probe.iteritems()) for probe in probes], [dict(probe.iteritems()) for probe in [probe_ref1, probe_ref2]])
def test_probe_destroy_by_sf_id(self): values1 = get_fake_probe('1') values2 = get_fake_probe('2') probe_ref1 = db_api.probe_create(self.conf, values1) probe_ref2 = db_api.probe_create(self.conf, values2) db_api.probe_destroy_by_sf_id(self.conf, '1') probes = db_api.probe_get_all(self.conf) self.assertEqual(len(probes), 1) self.assertEqual(probes[0]['id'], probe_ref2['id'])
def test_probe_destroy_by_sf_id(self): values1 = get_fake_probe("1") values2 = get_fake_probe("2") probe_ref1 = db_api.probe_create(self.conf, values1) probe_ref2 = db_api.probe_create(self.conf, values2) db_api.probe_destroy_by_sf_id(self.conf, "1") probes = db_api.probe_get_all(self.conf) self.assertEqual(len(probes), 1) self.assertEqual(dict(probe_ref2.iteritems()), dict(probes[0].iteritems()))
def test_probe_get_all(self): values = get_fake_probe('1') db_api.probe_create(self.conf, values) db_api.probe_create(self.conf, values) probes = db_api.probe_get_all(self.conf) self.assertEqual(len(probes), 2)