

@run_only_if_pymongo_is_available
@patch('pymongo.Connection')
@patch.object(Collector, 'publish')
def test_should_publish_stats_with_long_type(self, publish_mock, connector_mock):
    data = {
        'more_keys': long(1),
        'key': 2,
        'string': 'str',
    }
    self._annotate_connection(connector_mock, data)
    self.collector.collect()
    self.connection.db.command.assert_called_once_with('serverStatus')
    self.assertPublishedMany(publish_mock, {
        'more_keys': 1,
        'key': 2,
    })

dataset/ETHPy150Open BrightcoveOS/Diamond/src/collectors/mongodb/test/testmongodb.py TestMongoDBCollector.test_should_publish_stats_with_long_type/original