'Test posting with special conditions.
Do accept a single post with some multiples sources with some of them
null.'

def test_multiple_samples_multiple_sources(self):

    s1 = [{'counter_name': 'my_counter_name', 'counter_type': 'gauge', 'counter_unit': 'instance', 'counter_volume': 1, 'source': 'paperstack', 'project_id': '35b17138-b364-4e6a-a131-8f3099c5be68', 'user_id': 'efd87807-12d2-4b38-9c70-5f5c2ac427ff', 'resource_id': 'bd9431c1-8d69-4ad3-803a-8d4a6b89fd36'}, {'counter_name': 'my_counter_name', 'counter_type': 'gauge', 'counter_unit': 'instance', 'counter_volume': 5, 'source': 'waterstack', 'project_id': '35b17138-b364-4e6a-a131-8f3099c5be68', 'user_id': 'efd87807-12d2-4b38-9c70-5f5c2ac427ff', 'resource_id': 'bd9431c1-8d69-4ad3-803a-8d4a6b89fd36'}, {'counter_name': 'my_counter_name', 'counter_type': 'gauge', 'counter_unit': 'instance', 'counter_volume': 2, 'project_id': '35b17138-b364-4e6a-a131-8f3099c5be68', 'user_id': 'efd87807-12d2-4b38-9c70-5f5c2ac427ff', 'resource_id': 'bd9431c1-8d69-4ad3-803a-8d4a6b89fd36', 'resource_metadata': {'name1': 'value1', 'name2': 'value2'}}]
    data = self.post_json('/meters/my_counter_name/', s1, expect_errors=True)
    self.assertEqual(201, data.status_int)
    for (x, s) in enumerate(s1):
        s['source'] = ('%s:%s' % (s['project_id'], s.get('source', self.CONF.sample_source)))
        s['message_id'] = data.json[x]['message_id']
        s['timestamp'] = data.json[x]['timestamp']
        s.setdefault('resource_metadata', dict())
        self.assertEqual(s, data.json[x])
        s['monotonic_time'] = None
        self.assertEqual(s, self.published[0][x])
