'Test samples are saved.'

def test_direct_publisher(self):

    self.CONF.set_override('connection', self.db_manager.url, group='database')
    parsed_url = netutils.urlsplit('direct://')
    publisher = direct.DirectPublisher(self.CONF, parsed_url)
    publisher.publish_samples(self.test_data)
    meters = list(self.conn.get_meters(resource=self.resource_id))
    names = sorted([meter.name for meter in meters])
    self.assertEqual(3, len(meters), 'There    should    be    3    samples')
    self.assertEqual(['alpha', 'beta', 'gamma'], names)
